graudeejs Feb 12, 2009 #1 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.
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.
anemos Feb 12, 2009 #2 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].
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].
dap Feb 12, 2009 #3 You should learn about C++ strings and iostreams or stick to C. Here is a good resource about C++ : http://bruce-eckel.developpez.com/livres/cpp/ticpp/.
You should learn about C++ strings and iostreams or stick to C. Here is a good resource about C++ : http://bruce-eckel.developpez.com/livres/cpp/ticpp/.
F fonz Feb 13, 2009 #5 hydra said: I would recommend to start learning C instead of C++ Click to expand... Second that! Alphons (admitting that tastes may differ though)
hydra said: I would recommend to start learning C instead of C++ Click to expand... Second that! Alphons (admitting that tastes may differ though)