I am using reading the file one line by line and i am doing memcpy to
store the line into the structure
memset\(person,0,sizeof\(person\)\);
memcpy\(person,line1,37\) -- here line1 has the line from the file the above three lines i mentioned
The problem is that ,for 1 and 2 line i am getting the correct result , For third line it is storing
withthe space as well.
my Sname for line 3 contains
" X "
but it should be as
"X "
i used trim function on sname like trim\(person.Sname\). If i do this is is storing as a single character
as "X" ..
But i need the the 17 character string it should be as
i tried this , it is showing access vilolation error at the memcpy line . I tried with debugging . I can able to find the error only at memcpy line . Can you please help me to correct this.
It is compiling , but the error is comming at runtime
Are you trying to remove leading blanks and then adding them to the end of the array of characters stored in the struct person.
Post the source code you are using to accomplish this.