| | |
fwrite(size_t_count)
Thread Solved
![]() |
Hi,
can any one tell me what size_t_count does, i couldnt get it .
thanks guyz !
can any one tell me what size_t_count does, i couldnt get it .
thanks guyz !
fwrite(const void*_str,size_t_Size,size_t_count,file *_File);
DarkCoder+
•
•
•
•
Hi,
can any one tell me what size_t_count does, i couldnt get it .
thanks guyz !
fwrite(const void*_str,size_t_Size,size_t_count,file *_File);
fwrite(buff, sizeof(int), 4, someFile) means you want to write four ints to file. Last edited by andor; Oct 5th, 2006 at 9:40 am.
If you want to win, you must not loose (Alan Ford)
aha beautifull ! now i got it ! 
1 more question !
i used the strtok to read untill i reach a comma...
how can i replace the comma by a ";" ?
for example i want to do the same thing but now i want to write it to another file and replace the , by a semi colon ?!
have any idea how to do that with strtok or another function ?!
thx champ

1 more question !
strcpy(rcust[i].item, strtok(NULL,","));how can i replace the comma by a ";" ?
for example i want to do the same thing but now i want to write it to another file and replace the , by a semi colon ?!
have any idea how to do that with strtok or another function ?!
thx champ
DarkCoder+
use strchr() to find the comma then replace it
Now, put the above in a loop to find and replace all the commas in the string.
C Syntax (Toggle Plain Text)
char str[] = "Hello,World"; // find the comma char *ptr = strchr(str,',') // replace it if found if(ptr != NULL) *ptr = ';';
Now, put the above in a loop to find and replace all the commas in the string.
Last edited by Ancient Dragon; Oct 5th, 2006 at 9:55 am.
•
•
•
•
aha !
if i want to write to a file, do i have to fread it first or just
fwrite it straight away ?
thx champ
C Syntax (Toggle Plain Text)
for each line in the source file read a line replace all commas with semicolons write the string to the new file end
Actually, you read from one file, then write to another file. You don't want to read and write to the same file. It gets too complicated.
Last edited by WaltP; Oct 5th, 2006 at 3:25 pm.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
•
•
•
•
I did not suggest he write to the same file that he's reading. read the sudo-code again please -- "write to new file"
If you will read the OP recent post:
•
•
•
•
if i want to write to a file, do i have to fread it first or just
fwrite it straight away ?
Mr. WaltP's comment I think is directed to the OP.
I don't accept change; I don't deserve to live.
![]() |
Other Threads in the C Forum
- Previous Thread: qt3 designer help
- Next Thread: help required!!!!!
| Thread Tools | Search this Thread |
* adobe api array asterisks binarysearch calculate changingto char character cm copyanyfile copyimagefile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory feet fgets file floatingpointvalidation forloop frequency function givemetehcodez global grade gtkgcurlcompiling gtkwinlinux hacking highest histogram homework i/o infiniteloop input interest intmain() iso kernel keyboard kilometer km linked linkedlist linux looping loopinsideloop. lowest meter microsoft mqqueue mysql number oddnumber odf open openwebfoundation owf pdf performance posix power probleminc process programming pyramidusingturboccodes radix read recv recvblocked repetition research reversing scheduling segmentationfault send sequential single socket socketprogramming stack standard string suggestions systemcall threads turboc unix urboc user variable wab whythiscodecausesegmentationfault win32api windows.h windowsapi






