| | |
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 |
#include * adobe ansi api array asterisks binarysearch centimeter changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc csyntax database directory dynamic execv feet fgets file fork function getlasterror getlogicaldrivestrin givemetehcodez global grade gtkgcurlcompiling gtkwinlinux hacking hardware highest histogram ide include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping lowest match matrix meter microsoft motherboard mqqueue number odf opendocumentformat opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scripting segmentationfault sequential single socket socketprograming standard string systemcall threads turboc unix user voidmain() wab whythiscodecausesegmentationfault windows.h windowsapi






