c++ segfault

I get segfault at
f s c a n f
i don't understand why i get segfault

input.dat has:
10 Xasdf



sorry, when i write that normal, i get error.
 
That's because you haven't allocated space for name.
Either use the new operator or define its size statically i.e. char name[WHATEVER].
 
Back
Top