Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

090928ÈÕcÓïÑÔѧϰÈռǣ¨ÎļþI/O)

#include<stdio.h>
#include<stdlib.h>
#define MAX 41
static int i=0;
int main(void)
{
FILE *fp;
char words[MAX];
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stdout,"Can't open \" word\" file\n");
exit(1);
}
puts("Enter words to add to the file,press the enter.");
puts("Key at the begining of a line to terminate.");
while(gets(words)!=NULL&&words[0]!='\0')
{
fprintf(fp,"%s",words);
i++;
}
rewind(fp);
while(fscanf(fp,"%s",words)==1)
{
puts(words);
}
if(fclose(fp)!=0)
{
fprintf(stderr,"Error closing file.\n");
}
return 0;
}

#include<stdio.h>
#include<stdlib.h>
#define MAX 2000
int main(void)
{
FILE *fp;
char words[MAX];
int wordct=0;
if((fp=fopen("words","a+"))==NULL)
{
fprintf(stderr,"Can't open \" word\" file\n");
exit(1);
}
rewind(fp);
while (fgets(words, MAX - 1, fp) != NULL)
wordct++;
rewind(fp);
puts("Enter words to add to the file,press the enter.");
puts("Key at the begining of a line to terminate.");
while(gets(words)!=NULL&&words[0]!='\0')
{
fprintf(fp,"%d:%s",++wordct,words);
}
puts("File contents:");
rewind(fp);
while(fgets(words,MAX-1,fp)!=NULL)
{
fputs(words,stdout);
}
if(fclose(fp)!=0)
{
fprintf(stderr,"Error closing file.\n");
}
return 0;
}
/*ÎļþÃûÓÉÓû§ÊäÈ룬½¨Á¢Ò»¸öÑ­»·£¬ÈÃÓû§ÊäÈëÎļþλÖã¬
Ôò´òӡλÖõ½ÏÂÒ»¸ö»»ÐзûÖ®¼äµÄ×Ö·û£¬µ±ÊäÈë·ÇÊý×Ö×Ö·ûʱÍ˳ö*/
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#define MAX 41
int main(void)
{
FILE *fp;
char ch;
char file[MAX];
long address;
puts("ÇëÊäÈëÎļþÃû");
gets(file);
if((fp=fopen(file,"rb"))==NULL)
{
fprintf(stderr,"Can't open the %s\n",file);
exit(1);
}


printf("ÇëÊäÈëÒ»¸öÎļþλÖÃ\n");
while(1)
{
scanf("%ld",&address);
if(isdigit(address))
{
break;
}
fseek(fp,address,SEEK_SET);

while((ch=getc(fp))!='\n' && (ch=getc(fp)


Ïà¹ØÎĵµ£º

C++ÓëCµÄÇø±ð ±±º£

1£©  º¯ÊýÉùÃ÷
l         CÈç¹û²»Ð´·µ»ØÖµ£¬Ä¬ÈÏÊÇint£¬¶øC++Öв»Äܲ»Ð´·µ»ØÖµ(¿ÉÓÃvoid±íʾÎÞ·µ»ØÖµ)¡£
ÈçFunc1();
l         int Func1()ÔÚCÖбíʾ¿É´øÈÎÒâ²ÎÊýµÄº¯Êý£¬ÕâÊÇCµÄ©¶´£¬Ê¹µÃËü±Ü¿ªÁ˲ÎÊýÀàÐͼì²é£»¶øC++Öбíʾ²»´ ......

CÒÅÁôµÄ½á¹¹Ìøת ±±º£

1)          goto
goto Ö»ÄÜÔÚÒ»¸öº¯ÊýÄÚÌøת¡£½¨ÒéÉÙÓã¬Ê¹µÃ³ÌÐòά»¤ÆðÀ´ÈÝÒ׳ö´í£»µ«ÊÇ£¬ÔÚÓжà¸öÑ­»·Çé¿öÏÂÌøת£¬ÓÐʱÓÃgoto¿ÉÒÔʹµÃÎÊÌâ±äµÃ¼òµ¥¡£
class A
{
public:
A(){}
~A(){}
};
           &nbs ......

̽Ë÷еÄC + +ºÍMFCÔÚVisual Studio 2010¹¦ÄÜ

̽Ë÷еÄC + +ºÍMFCÔÚVisual Studio 2010¹¦ÄÜ
Sumit Kumar
2010ÄêÁгöµÄVisual Studio C + +¿ª·¢µÄ¾Þ´óºÃ´¦¡£´Ó¹ÍÓÃÄÜÁ¦ÌṩÓÉWindows 7´óÁ¿´úÂëµÄ»ù´¡¹¤×÷£¬ÒÔÔöÇ¿Éú²úÁ¦ÌØÕ÷µÄÐÂÌص㣬ÓÐһЩеĶ«Î÷£¬Ìá¸ßÁ˼¸ºõËùÓеÄC + +¿ª·¢ÈËÔ±¡£
ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ½«½âÊÍ΢ÈíÒѾ­½â¾öÁËÈçºÎÓÃC + +¿ª·¢ÈËÔ±ËùÃæÁٵĹ㷺µÄһЩÎÊÌ ......

extern "C"(zz)


 ´ÓijλÍøÓѵIJ©¿Í¿´µ½¹ØÓÚextern "C"Ó÷¨µÄÎÄÕ£¬½²µÃ·Ç³£Í¸³¹£¬ÓÚÊǾÍÕª³­ÁËÎÒ֮ǰ²»ÉõÁ˽âµÄ²¿·Ö×ö¸öbackup¡£
Ò»¡¢´ÓCÓëC++±àÒëÁ¬½Ó·½Ê½ÉîÈëÀí½âextern "C"
<1>.CºÍC++¶Ôº¯ÊýµÄ´¦Àí·½Ê½ÊDz»Í¬µÄ.±»extern "C"ÐÞÊεıäÁ¿ºÍº¯ÊýÊÇ°´ÕÕCÓïÑÔ·½Ê½±àÒëºÍÁ¬½ÓµÄ.extern "C"ÓÃÓÚʵÏÖC++ÓëC¼°ÆäËüÓïÑԵĻìºÏ±à³Ì¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ