So I started a new program and I'm using wide characters (wchar_t). This is all new to me and I'm having a hard time adjusting to the new syntax. One of the problems I'm having is trying to read a line from a file. I normally use sscanf. But I now have to use swscanf. Here's the line:
card is a struct pointer passed into the function
This is what readLine is:
Code:
1 1 2 FALLEN TITAN* 1 4 304 1880 0 d
Code:
swscanf(readLine,L"%d %d %d %[^*] %d %d %d %d %d %[^\n]",&card->copies,
&card->level,
&card->type,
card->name,
&card->rarity,
&card->faction,
&card->damage,
&card->hp,
&card->specialLetters,
card->traits);
The issue with this is that the first 3 ints are read fine, and then the string is read fine. But everything after the string is zero and the last string (traits) is empty. I'm pretty sure it has something to do with my %[^*]. I used that in sscanf to read all characters up to the asterisk. That allowed me to read strings with spaces because the asterisk acts like a delimiter.
Any ideas on what is going wrong?