| | |
Something wrong with my code, why Junk character appears?
![]() |
•
•
Join Date: Sep 2004
Posts: 2
Reputation:
Solved Threads: 0
Hello,
I am new to this site, found reference through google.com.
I am attaching a sample code.
The variable “file_nm� is pointed to proper file.
I am suppose to write a program, which will…
1. Open a file.
2. Search for string “APPLY DATE:�
e.g. APPLY DATE:
3. If the string is found then place the date next to that statement
i.e. the statement should look like
APPLY DATE: 2004-07-28:21:32:16
4. But somehow my code is not working as per expectations, it is writing
a junk character along with the date
i.e. the output looks like
Apply Date:ÿ2004-07-28:21:32:16
My Code: Please ferfer to the attached file
Questions:
1] What is that junk character stands for?
2] What is wrong with the code?
Thanks in Advance.
I am new to this site, found reference through google.com.
I am attaching a sample code.
The variable “file_nm� is pointed to proper file.
I am suppose to write a program, which will…
1. Open a file.
2. Search for string “APPLY DATE:�
e.g. APPLY DATE:
3. If the string is found then place the date next to that statement
i.e. the statement should look like
APPLY DATE: 2004-07-28:21:32:16
4. But somehow my code is not working as per expectations, it is writing
a junk character along with the date
i.e. the output looks like
Apply Date:ÿ2004-07-28:21:32:16
My Code: Please ferfer to the attached file
Questions:
1] What is that junk character stands for?
2] What is wrong with the code?
Thanks in Advance.
•
•
Join Date: Sep 2004
Posts: 1
Reputation:
Solved Threads: 0
hello,
I saw u r code and i am expecting one answer if right(u think) consider other wise leave it.
After reading the set of strings it will move to end of the file. As u stored only the APPLY DATE and u have given to read 256 possible characters file pointer moves to end of file. so now u r writing after tht , so that is nothing but a special symbol to indicate the end of file
that's i am expecting.
ok
bye
I saw u r code and i am expecting one answer if right(u think) consider other wise leave it.
After reading the set of strings it will move to end of the file. As u stored only the APPLY DATE and u have given to read 256 possible characters file pointer moves to end of file. so now u r writing after tht , so that is nothing but a special symbol to indicate the end of file
that's i am expecting.
ok
bye
•
•
Join Date: Sep 2004
Posts: 2
Reputation:
Solved Threads: 0
Hi,
Thanks for the reply. appreciated!!
My file is very large in size. I am writing only the part of it out here.
This is a report output file and below is the header of the file
after the header, the file contains the output from a particular table.
I need to update only the header after the report gets generated.
Header:
Configuration Name: \ANDES DEFAULT
Configuration Revision: 5
Software Release: Z08.00
Apply Date:ÿ2004-07-28:21:32:16
Site Id: 035409
System Name: \ANDES
Logical Target Name: DEFAULT
: : : :
: : : :
: : : :
And here the Apply Date is getting junk character when I use fputs.
Thanks in Advance.
Thanks for the reply. appreciated!!
My file is very large in size. I am writing only the part of it out here.
This is a report output file and below is the header of the file
after the header, the file contains the output from a particular table.
I need to update only the header after the report gets generated.
Header:
Configuration Name: \ANDES DEFAULT
Configuration Revision: 5
Software Release: Z08.00
Apply Date:ÿ2004-07-28:21:32:16
Site Id: 035409
System Name: \ANDES
Logical Target Name: DEFAULT
: : : :
: : : :
: : : :
And here the Apply Date is getting junk character when I use fputs.
Thanks in Advance.
![]() |
Similar Threads
- what's wrong in this code? (PHP)
- What's wrong with this code? (C#)
- What is wrong with this code? (C++)
- What is wrong with this code??? (Visual Basic 4 / 5 / 6)
- Whats wrong with this code (PHP)
Other Threads in the C Forum
- Previous Thread: making a matrix
- Next Thread: reference problems
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile createprocess() csyntax database directory dynamic feet fflush fgets file fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue mysql number odf open openwebfoundation owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling segmentationfault send sequential shape socket socketprograming stack standard string systemcall turboc unix user voidmain() wab win32api windows.h






