ɾ³ýC/C++×¢ÊÍ
/********************************************************************
*ɾ³ýC/C++×¢ÊÍ
**********************************************************************/
#include <stdio.h>
//×¢Òâ
//1.¶Ô/****/µÄ´¦Àí
//2.Òª±£ÁôË«ÒýºÅÖ®¼äµÄÄÚÈÝ£¬Èçchar* test = "/*i am not comment */";
//3.¶ÔÓÚµ¥ÒýºÅÖеÄÄÚÈÝͬÑù±£Áô(²»¼ì²é³ÌÐòµÄÓï·¨´íÎó)
//4.¶ÔÓÚתÒå×Ö·ûµÄ´¦Àí(¼û״̬6)£¬Èçchar* test = "string\"string too/*i am not comment"
int noComment(FILE *in,FILE *out)
{
int ch, lastch, state = 0, sq = 0;
while( ( ch = fgetc(in) ) != EOF )
{
switch(state)
{
case 0:
if( ch == '/' )
{
lastch = '/' ;
state = 1 ;
}
else
{
if( ch == '\'' || ch == '"' )
{
state = 5 ;
if( ch == '\'' )
sq = 1;
}
fputc(ch, out);
&n
Ïà¹ØÎĵµ£º
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include ".\sqlite3_lib\sqlite3.h"
static int _callback_exec(void * notused,int argc, char ** argv, char ** aszColName)
{
int i;
for ( i=0; i<argc; i++ )
......
×ÜÊDZ»Í¬Ñ§ÃÇÎʵ½,ÈçºÎѧϰCºÍC++²Å²»Ã£È»,²Å²»ÊÇÂÒѧ¡£ÏëÁËÒ»ÏÂ,ÕâÀï¸ø³öÒ»¸ö×ܵĻظ´¡£
Ò»¼ÒÖ®ÑÔ,»¶ÓÅÄש¹þ¡£
1¡¢¿ÉÒÔ¿¼ÂÇÏÈѧϰC
´ó¶àÊýʱºò,ÎÒÃÇѧϰÓïÑÔµÄÄ¿µÄ,²»ÊÇΪÁ˳ÉΪһ¸öÓïÑÔר¼Ò,¶øÊÇÏ£Íû³ÉΪһ¸ö½â¾öÎÊÌâµÄר¼Ò¡£×öÒ»¸öÓ ......
1¡¢°²×°»ù´¡Àà¿âºÍman°ïÖúÎĵµµÈ
sudo apt-get install build-essential sun-java6-jdk debian-keyring g++-multilib g++-4.2-multilib gcc-4.2-doc libstdc++6-4.3-dbg equivs glibc-doc manpages-dev libstdc++6-4.3-doc diff-doc binfmt-support sun-java6-source manpages manpages-posix manpages-posix- ......
»ªÎªC/C++±ÊÊÔÌâ2 ÊÕ²Ø
1. ij32λϵͳÏÂ, C++³ÌÐò£¬Çë¼ÆËãsizeof µÄÖµ
#include <stdio.h>
#include <malloc.h>
void Foo ( char str[100] )
{
printf("sizeof(str)=%d \n", sizeof(str) );//´Ë´¦Ê¹ÓÃchar *strÓëchar str[100]ÊÇÒ»ÑùµÄ£¬char str[100]²»Ö¸Ã÷´óС(char str[]) ......
ºÍÔÚIDEÖбàÒëÏà±È£¬ÃüÁîÐÐģʽ±àÒëËٶȸü¿ì£¬²¢¿ÉÒÔ±ÜÃâ±»IDE²úÉúµÄһЩ¸½¼ÓÐÅÏ¢Ëù¸ÉÈÅ¡£±¾ÎĽ«½éÉÜ΢ÈíC/C++±àÒëÆ÷ÃüÁîÐÐģʽÉ趨ºÍÓ÷¨¡£
1¡¢ÉèÖû·¾³±äÁ¿£º
PATH=C:\Program Files\Microsoft Visual Studio 8\VC\bin
INCLUDE=C:\Program Files\Microsoft Visual Studio 8\VC\include
LIB=C:\Program File ......