Sorry another similar question related to this
How do I read in a string
"DOB = 10-10-1970"
from a file and assign it to char arrays dob1, dob2 and dob3...?
this is my code
Code:
fgets(buffer, 40, fp);
sscanf(buffer, "DOB = %2c-%2c-%4c\n", custList[i].dob1, custList[i].dob2, custList[i].dob3);
It doesn't seem to work when I print them out
it gives
101019790-3233
-10-19790-3233
0-19790-3233
when I puts the three variables...
This is the text file :
Code:
Account Id = 123
Name = Matt Damon
Address = 465 Ripley Boulevard, Oscar Mansion, Singapore 7666322
DOB = 10-10-1970
Phone Number = 790-3233
Account Balance = 405600.00
Pier.