•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 402,860 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,943 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums
Views: 2587 | Replies: 58 | Solved
![]() |
hmm, ok go to
start > run then type cmd then click ok
In command prompt if it isn't already pointing and c:\>
keep typing cd.. <enter>
until you get there.
When it is pointing at c:\> type in dir and tell me if you see data.txt listed there?
I have a suspicion it will show data.txt.txt
start > run then type cmd then click ok
In command prompt if it isn't already pointing and c:\>
keep typing cd.. <enter>
until you get there.
When it is pointing at c:\> type in dir and tell me if you see data.txt listed there?
I have a suspicion it will show data.txt.txt
Last edited by iamthwee : Nov 24th, 2007 at 2:37 pm.
Member of: F-ugly code club
Join today don't delay!
Join today don't delay!
•
•
Join Date: Nov 2007
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
C Syntax (Toggle Plain Text)
{ char path[150]; fputs ( "Please Enter The Path Of The File You Would Like To Read From: ", stdout ); gets(path); fflush ( stdout ); FILE *fp; char buf[BUFSIZ] = "crrrrrapppp"; int i; if ((fp = fopen(path, "r")) == NULL) { perror (path); return (EXIT_FAILURE); } i = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { printf ("Line %4d: %s", i, buf); i++; } fclose(fp); putchar('\n'); return(0); }
Got that working now mate... User can define the path! Why is the BUFSIZ defined as Crrraaap? ... i dont have any uderstanding of this.
Last edited by r5ingh : Nov 24th, 2007 at 2:45 pm.
•
•
Join Date: Nov 2007
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
1>: error C2664: 'encode' : cannot convert parameter 1 from 'char [512]' to 'char'
im trying this:
im guessing that it cannot convert the string because encode takes characters.
im trying this:
C Syntax (Toggle Plain Text)
void file() { FILE *fp; char buf[BUFSIZ] = "crrrrrapppp"; int i; if ((fp = fopen(MYFILE, "r")) == NULL) { perror (MYFILE); } i = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { printf ("File Contains: %s", buf); i++; } putchar ('\n'); encode(buf); fclose(fp); }
im guessing that it cannot convert the string because encode takes characters.
Last edited by r5ingh : Nov 24th, 2007 at 2:51 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- help needed on a loop again (C++)
- Square root program without sqrt or pwr (C++)
- IT project help (Pascal and Delphi)
- open a file and divide its data in arrays (C)
- C++ nest loop program - Help (C++)
- I don't know where is the question occured. (C)
- sorting parallel arrays (C)
Other Threads in the C Forum
- Previous Thread: HELP: Day 0 - Chroma Key Programming
- Next Thread: Pascal's Triangle in C



Linear Mode