No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Student wants to learn more about programming...for now
hi guys...i have a problem concerning strcmpi not equal while inside a while loop. Check out my code below: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> main() { char yr[4],new_yr[4]; int x=0; FILE *fp1; printf("Enter Year: ");scanf("%s",new_yr); printf("\n"); printf("You Entered Year %s\n\n",&new_yr); if(strlen(new_yr)==4) { fp1=fopen("year.txt","r"); while(fscanf(fp1,"%s",yr)>0) { if(strcmpi(yr,new_yr)!=0) { fp1=fopen("year.txt","a"); fprintf(fp1,"\n%s",new_yr); fclose(fp1); x=1; … |
|
String Compare and File Handling mixing together... I am practicing my self to combine functions together like this. so get this, is it possible to search record from the File using File Handling(fscanf) and compare it from the User's input and display it...check out my program. content of **2003.txt** 1234 … |
|
Re:
Hi everyone..................... I am a new member in this forum and this my first post in it. |
|
i want to know how to read all the message inside the file including their spacing,indents if possible using File Handling... can that be done? content of data1.txt: First Name: (TAB)John Doe Last name:(TAB) Manly Height:(TAB) 5'7 Weight:(TAB)164 kls Address:(TAB)Somewhere but here, (TAB)but not to far City. here is my … |