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++ Reference
http://www.cppreference.com/
C++ Library Reference
http://www.cplusplus.com/ref/
Standard C++ Library Class Reference at Rogue Wave
http://www.roguewave.com/support/docs/hppdocs/stdref/
Dink ......
°ÑÊäÈëµÄÒ»´®×Ö·ûת³ÉÊý×飬ת³ÉÁ´±í£¬È»ºóɾȥÆäÖÐÖ¸¶¨µÄ×Ö·û£¬ÔÚβ²¿Ìí¼ÓÒ»¸ö×Ö·û¡£
£¨³ÌÐò»¹²»ÍêÉÆ£¬Ã»ÓжÔÊä´íµÄÇé¿ö½øÐд¦Àí£¬£¬ÔÝʱÏÈÕâÑù°É¡£¡£= =¡££©
#include<stdio.h>
#include<malloc.h>
#define LEN sizeof(struct link)
struct link
{
char ch;
struct link *next;
}*string;
char a ......
linux³£ÓÃÍ·ÎļþÈçÏ£º
POSIX±ê×¼¶¨ÒåµÄÍ·Îļþ
<dirent.h>
Ŀ¼Ïî
<fcntl.h> Îļþ¿ØÖÆ
<fnmatch.h> ÎļþÃûÆ¥ÅäÀàÐÍ
<glob.h>
·¾¶ÃûģʽƥÅäÀàÐÍ
< ......
̽Ë÷еÄC + +ºÍMFCÔÚVisual Studio 2010¹¦ÄÜ
Sumit Kumar
2010ÄêÁгöµÄVisual Studio C + +¿ª·¢µÄ¾Þ´óºÃ´¦¡£´Ó¹ÍÓÃÄÜÁ¦ÌṩÓÉWindows 7´óÁ¿´úÂëµÄ»ù´¡¹¤×÷£¬ÒÔÔöÇ¿Éú²úÁ¦ÌØÕ÷µÄÐÂÌØµã£¬ÓÐһЩÐµĶ«Î÷£¬Ìá¸ßÁ˼¸ºõËùÓеÄC + +¿ª·¢ÈËÔ±¡£
ÔÚÕâÆªÎÄÕÂÖУ¬ÎÒ½«½âÊÍ΢ÈíÒѾ½â¾öÁËÈçºÎÓÃC + +¿ª·¢ÈËÔ±ËùÃæÁٵĹ㷺µÄһЩÎÊÌ ......