Search:
Forum
General C++ Programming
Problems with Scanf()
Problems with Scanf()
Jun 8, 2012 at 8:15pm UTC
forceface
(39)
I am trying to import 3 columns of data that are all in one text file. I thought scanf would do the trick but i dont think i understand it well enough
for
(
int
i=0;i<N;i++) scanf(
"%lf %lf %lf"
, &x[i], &y[i], &err[i]);
could anyone help me out.
Jun 8, 2012 at 8:23pm UTC
vlad from moscow
(6539)
scanf is used for the standard input. You should use fscanf.
Jun 8, 2012 at 8:42pm UTC
forceface
(39)
so if i simply replaced scanf with fscanf it should work?
Jun 8, 2012 at 8:55pm UTC
vlad from moscow
(6539)
You should read description of fscanf before using it.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs