| | |
fwrite(size_t_count)
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
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.
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
![]() |
Other Threads in the C Forum
- Previous Thread: qt3 designer help
- Next Thread: help required!!!!!
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme createcopyoffile csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling scripting segmentationfault send shape socketprograming spoonfeeding stack standard string strings structures student suggestions systemcall test testautomation unix user variable voidmain() wab win32api windows.h






