C/C++ѧϰ
×î½ü¶Ô»ù´¡ÖªÊ¶½øÐÐÁËѧϰ£¬·¢ÏÖÒÔÇ°ºÜ¶à¶«Î÷¶¼Ã»ÓиãÇå³þ
1. ±àÒëµÄÎÊÌ⣬ͷÎļþÖ÷ÒªÊǶ¨Òå
//////// add.c
int add(int a, int b)
{
return a + b;
}
///////// main.c
#include <stdio.h>
int add(int a, int b);
int main ()
{
printf("%d", add(1, 2));
return 0;
}
ÕâÊÇ¿ÉÒÔÕýÈ·±àÒëÖ´Ðеģ¬Ã»ÓÐʹÓÃÍ·Îļþ
2. ¼Ì³ÐµÄһЩ֪ʶµã
ÅÉÉúÀàÏò»ùÀà¶ÔÏó¸³ÖµÊ±£¬¸ø»ùÀà±äÁ¿´«ÈëµÄÊý¾ÝÊÇÆä±¾Éí»ùÀàµÄ¶ÔÓ¦µÄÊý¾Ý
Ïà¹ØÎĵµ£º
.hÖÐÒ»°ã·ÅµÄÊÇͬÃû.cÎļþÖж¨ÒåµÄ±äÁ¿¡¢Êý×é¡¢º¯ÊýµÄÉùÃ÷£¬ÐèÒªÈÃ.cÍⲿʹÓõÄÉùÃ÷¡£
1)hÎļþ×÷ÓÃ
1 ·½±ã¿ª·¢:°üº¬Ò»Ð©ÎļþÐèÒªµÄ¹²Í¬µÄ³£Á¿,½á¹¹,ÀàÐͶ¨Òå,º¯Êý,±äÁ¿ÉêÃ÷£»
2 Ìṩ½Ó¿Ú:¶ÔÒ»¸öÈí¼þ°üÀ´Ëµ¿ÉÒÔÌṩһ¸ö¸øÍâ½çµÄ½Ó¿Ú(ÀýÈç: stdio.h)¡£
2)hÎļþÀïÓ¦¸ÃÓÐʲô
³£Á¿,½á¹¹,ÀàÐ ......
º¯ÊýÊdzÌÐòµÄÖ´ÐÐÄ£¿é£¬ÊÇÕû¸öÏîÄ¿µÄϸ°û£¬ÈçºÎ×éÖ¯ºÃÿһ¸öº¯ÊýµÄ½á¹¹£¬ÈçºÎÌá¸ß³ÌÐòµÄ¿É¶ÁÐÔºÍÔËÐÐЧÂÊ£¬ÊdzÌÐòÔ±ÃDz»¶ÏƷζµÄÖ÷Ìå¡£ÓÐʱº¯ÊýµÄÉè¼ÆÄÜÖ±½ÓÌåÏÖ³ö³ÌÐòÔ±¶ÔC/C++µÄÀí½âºÍ¸ÐÎò¡£
C/C++µÄº¯ÊýÀàÐͲ»¶ÔÍâºõÒÔϼ¸ÖÖ£¬ÓÐЩÃèÊö¿ÉÄܲ»Ì«ÌùÇУº
......
ÔÚÍøÉÏÕÒµ½µÄÒ»¸ö³ÌÐò
[c]
#include <stdio.h>
#include <sys/types.h>
#include <regex.h>
/* È¡×Ó´®µÄº¯Êý */
static char* substr(const char*str,unsigned start, unsigned end)
{
unsigned n = end - start;
static char stbuf[256]; ......
—¡ï—ÅàѵÖÜÆÚ£º¹²950ѧʱ 5¸öÔÂ
—¡ï—Åàѵ¸½Ôù£º±£Ö¤Ñ§Ô±ÈËÊÖÒ»»úºÍÒ»Ì×ARM9¿ª·¢°å
—¡ï—ÅàѵÄÚÈÝ£ºÔÚÏîÄ¿¾ÀíµÄ´øÁìÏ£¬Í¨¹ýÍê³É¾ÖÍøµÄÂ齫ÓÎÏ·¡¢My ICQ(ÍøÂçÁÄÌì)ºÍ·¢µç»úÔÚÏß¼à¿Øϵͳ£¬BTÏÂÔØÈí¼þ£¬ÕÆÎÕ»ùÓÚLinuxºÍWindowsƽ̨ϵÄC/C++ÆóÒµ¼¶Ó¦ÓõĿª·¢¼¼ÄÜ£¬ÕÆÎÕ´óÐÍÈí¼þÏî ......
qtĬÈϵıà³ÌÓïÑÔΪC++ÓïÑÔ¡£Èç¹ûÄãÓÃqt±àÒë.cÎļþ£¬»á³öÏÖÕÒ²»µ½CÓïÑÔµÄĬÈÏÍ·ÎļþµÈ´íÎó£¨È磺stdio.hµÈ£©¡£qtÖв»Ö§³Ö
extern "C"{}µÄÕâÖÖд·¨£¬ÎÒÇ°¼¸ÌìÓÐÒ»¸öC³ÌÐòÐèÒªÒÆÖ²µ½QtµÄ¹¤³ÌÖУ¬±¾Ï£ÍûÖ±½Óextern "C"¾ÍokÁË£¬µ«·¢ÏÖqt4¾ÓÈ»²»Ö§³ÖÕâÖÖд·¨¡£ÎҵijÌÐòÖÐÓõ½Á˺ü¸¸ölinuxϵͳͷÎļþ£¬ÊÇÏò´®¿Ú·¢Ö¸ÁîÖ®ÀàµÄ³ÌÐò ......