object C Óï·¨
XCode£ºÄã¿ÉÒÔ°ÑËü¿´³ÉÊÇÒ»¸ö¿ª·¢»·¾³£¬¾ÍºÃÏñVisual Studio»òÕßNetbeans»òÕßSharpDevelopÒ»ÑùµÄÍæ
Òâ¡£Äã¿ÉÒÔ½«Interface BuilderÈÏΪÊÇVisual StudioÖÐÓÃÀ´»½çÃæµÄÄDz¿·Ö¹¦Äܵ¥¶ÀÌá³öÀ´µÄ³ÌÐò¡£
Objective-C£ºÕâÊÇÒ»ÖÖÓïÑÔ£¬¾ÍºÃÏñc++ÊÇÒ»ÖÖÓïÑÔ£¬JavaÊÇÒ»ÖÖÓïÑÔ£¬c#ÊÇÒ»ÖÖÓïÑÔ£¬Ýº¸èÀúÊ·Ò²ÊÇÒ»
ÖÖÓïÑÔÒ»Ñù¡£
Cocoa£ºÊÇÒ»´ó¶Ñº¯Êý¿â£¬¾ÍºÃÏñMFC¡¢.NET¡¢SwingÕâÀàÍæÒ⣬È˼ÒÒѾдºÃÁËÒ»¶ÑÏֳɵĶ«Î÷£¬ÄãÖ»Òª
ÖªµÀÔõôÓþͿÉÒÔÁË¡£
¼õºÅ±íʾһ¸öº¯Êý¡¢»òÕß·½·¨¡¢»òÕßÏûÏ¢µÄ¿ªÊ¼
À¨ºÅ¿ÉÒÔÈÏΪÊÇÈçºÎµ÷ÓÃÄã¸Õ²ÅдµÄÕâ¸ö·½·¨£¬Í¨³£ÔÚObjective-CÀï˵“ÏûÏ¢”¡£
ͬһ¸öÊý×é¿ÉÒÔ±£´æ²»Í¬µÄ¶ÔÏó
CÓÃNULL,OCÓÃnil
Objective-C ÓÐÖÖ½Ð×ö id µÄÐͱð£¬ËüµÄÔË×÷ÓÐʱºòÏñÊÇ void*£¬²»¹ýËüÈ´Ñϸñ¹æ¶¨Ö»ÄÜÓÃÔÚ¶ÔÏó¡£
»ù±¾Àà±ð¿â import NSObject.h£»BOOLÐÍΪYES or NO
#import vs #include£º#import¡£#import ÓÉ gcc ±àÒëÆ÷Ö§³Ö¡£ÎÒ²¢²»½¨ÒéʹÓà #include£¬#import »ù
±¾Éϸú .h µµÍ·Î²µÄ #ifndef #define #endif Ïàͬ¡£
Objective-C µÄÔ¤ÉèÀ©Õ¹ÃûÊÇ .m
Àࣺ@interface... @end
Implementation ÒÔ @implementation ClassName ¿ªÊ¼£¬ÒÔ @end ½áÊø£¬ÓÃÀ´¶¨ÒåÀàÀïµÄº¯Êý
¼Ì³Ð£¨inheritance£©ÒÔ Class: Parent ±íʾ£¬¾ÍÏñÉÏÃæµÄ Fraction: NSObject
ÔÚ Objective-C Öкô½Ð methods µÄ·½·¨ÊÇ [object method]£¬¾ÍÏñ C++ µÄ object->method()
[object init] ÊÇÒ»¸ö½¨¹¹×Ó£¨constructor£©ºô½Ð£¬¸ºÔð³õʼ»¯¶ÔÏóÖеÄËùÓбäÁ¿¡£
[frac setNumerator: 1] ·Ç³£¼òµ¥¡£Ëüºô½ÐÁË frac É쵀 setNumerator method ²¢´«Èë 1 Ϊ²ÎÊý
Objective-C Ò²ÓÐÒ»¸öÓÃÒÔÊÍ·ÅÄÚ´æµÄ·½Ê½£º release
´«µÝ¶àÖزÎÊýÓÃset..and£º[frac2 setNumerator: 1 andDenominator: 5]£»µ¥ÖØʱֻÓÃset
¼ÓÈëÆäËü²ÎÊýµÄ·½·¨¾Í¸ú¼ÓÈëµÚ¶þ¸öʱһÑù£¬¼´ method:label1:label2:label3: £¬¶øºô½ÐµÄ·½·¨ÊÇ obj
method: param1 label1: param2 label2: param3 label3: param4]
½¨¹¹×Ó£¨Constructors£©
@interface ÀïµÄÐû¸æ¾ÍÈçͬÕý³£µÄº¯Ê½
@implementation ʹÓÃÁËÒ»¸öеĹؼü´Ê£ºsuper
ʹÓà [super init] À´´æÈ¡ Super constructor£¬Õâ¸ö¶¯×÷ÐèÒªÊʵ±µÄ¼Ì³ÐÉè¼Æ
´æȡȨÏÞ
Ô¤ÉèµÄȨÏÞÊÇ @protected
¾ÍÏñ C++ ÖÐ private: [list of vars] public: [list of vars] µÄ¸ñʽ£¬ËüÖ»ÊǸijÉÁË@private,
@protected, µÈµÈ
Class level access
static int count = 0; ÕâÊÇ cla
Ïà¹ØÎĵµ£º
Ò»¡¢ÌáÇ°µÄ»°
¡¡¡¡ÒªËµCÓïÑÔºÍLinuxµÄ¹Øϵ´ó¼ÒÓ¦¸Ã¶¼²»»áÄ°Éú£¬LinuxϵͳÄں˾ÍÊÇÓÃCÓïÑÔ¿ª·¢µÄ£¬ËùÒÔËùÓеÄLinuxϵͳÏÂÃæ ¶¼»áÓÐCµÄ±àÒëµ÷ÊÔ¹¤¾ß£¬²»¹ýÕâЩ¹¤¾ß¶¼ÊÇÃüÁîʽµÄ£¬Õýʽ¿ª·¢µÄ»°»áºÜ²»·½±ã¡£FedoraÔÚ°²×°µÄʱºò¿ÉÒÔÑ¡Ôñ°²×°Fedora Eclipse£¬Õâ¸öIDEºÜÇ¿´ó£¬C£¬C++£¬Java£¬PythonµÈµÈ¶¼Ö§³Ö£¬¶øÇÒ±àÒ룬µ÷ÊÔºÍ ......
תÔØÇë×¢Ã÷³ö´¦£º±à³Ì±Ê¼ÇBLOG
¹¤ÓûÉÆÆäÊ£¬±ØÏÈÀûÆäÆ÷¡£ÓÃÁËÕâô¾ÃµÄlinux£¬ÏÖÔڱȽÏÖ÷Á÷µÄ¼¸¸öC/C++µÄIDE»ù±¾ÒѶ¼ÓùýÁË£¬ÏÖÔÚÀ´¶ÔËûÃÇ×öһϼòµ¥µÄ±È½Ï¡£
1¡¢VIM
Ê×ÏÈҪ˵µÄÊÇVIM¡£ÎÒÈÏΪ£¬VIMÖ»ÊÇÒ»¸ö±à¼Æ÷£¬²»ÄÜËãÊÇIDE¡£Ëä˵VIMÓкܶà²å¼þ£¬ÀýÈç´úÂëÕÛµþ¡¢µÝ½øµÈ£¬¿ÉÒÔ½«VIM×齨³É¼¸ºõÀàËÆÒ»¸öIDE£¬µ«Ê¼ÖÕËü²»ÊÇ× ......
ÔÚnetbeansÖбà¼C/C++ÊÇÒ»ÖÖ²»´íµÄÑ¡Ôñ£¬ÏÂÃæÎÒ¾Í˵һÏÂÕû¸öÁ÷³ÌµÄÅäÖÃ
1.ÏÈÏÂÔØMinGW
ÕâÊDZàÒëc/c++µÄ±àÒëÆ÷£¬ÔÚwindowsÏÂÖ±½ÓÒÔ.exeµÄ·½Ê½ÔËÐУ¬ÏÂÒ»²½µÄ²Ù×÷£¬Ò»Ö±µ½°²×°Íê³É¡£
2.ÏÂÔØmsys
ÕâÊǺÍMinGWͬ²½Ê¹ÓÃ
3.ÅäÖû·¾³
ÔÚÎҵĵçÄÔ->ÊôÐÔ->¸ß¼¶->»·¾³±äÁ¿ÖÐÉèÖÃMinGWºÍmsysĿ¼ÖÐbinËùÔڵķ¾¶
4.²âÊÔ
ÓÃÃüÁîÐз½Ê½Ê ......
/////////////////////////////////////////////////
// Ö÷Ì⣺һ¶ÎÓÃÀ´ÅжÏÈÕÆÚÊÇÐÇÆÚ¼¸µÄ´úÂë
// ÃèÊö£ºÕª×Ô¡¶CCFAQ¡·
// ×÷ÕߣºÌìÖ®·ã
// ʱ¼ä£º2010-02-13
/////////////////////////////////////////////////
#include <stdio.h>
int dayofweek(int y, int m, int d) // ÅжÏÊäÈëµÄÈÕÆÚÊÇÐÇÆÚ¼¸
......
[C/C++ Digestion] –
ÖØÔزÙ×÷·û
×÷Õߣº
Jason Lee @
http://blog.csdn.net/jasonblog
ÈÕÆÚ£º
2010-04-17
[1]
ÖØÔزÙ×÷·û
ÖØÔزÙ×÷·û´Ó´óµÄ·½ÃæÀ´½²¿ÉÒÔ·ÖΪÁ½Àࣺ×îºÃ»ò±ØÐë×÷ΪÀàµÄ³ÉÔ±º¯ÊýµÄ£¬ÒÔ¼°Ïà·´¡£¶ø¾ßÌåµØ½²£¬×îºÃ»ò±ØÐë×÷ΪÀàµÄ³ÉÔ±º¯ÊýµÄÓи³Öµ²Ù×÷·û
( = )
¡¢Ï±ê²Ù×÷·û
( [] ) ......