is it possible to accept values via a function without directly using scanf(). if yes plz tel how. plz look at the attachment, wats the error in it? how can i achieve the aforesaid intention.
Printable View
is it possible to accept values via a function without directly using scanf(). if yes plz tel how. plz look at the attachment, wats the error in it? how can i achieve the aforesaid intention.
- Your file ends in .cpp. You are asking for help in the C subforum.
- You can only return one variable or value. You are attempting to return multiple variables in your scan() function.
- The pointers in your scan() function are dangling pointers. You never initialized them.
- Your program uses the scanf function directly.
- There are multiple ways to scan in data. For example, using gets. But gets is not a "safe" function.
- Using "goto" when not needed is generally seen as a poor programming habit.
- conio.h isn't standard C. It's better to just use getchar to keep the console open.
but how can it be done??
Yes, by using say, fscanf or sscanf, or by parsing the input yourself.