scanf
How can I quit a while loop in Objective C using scanf and a C character array string comparison?
I am writing a simple test program to quit a while loop when the user enters EXIT: char *userEntry; while(userEntry != \"EXIT\")[详细]
2023-02-20 03:19 分类:问答C reading in multiple lines from file
The problem I have is reading in multiple lines of integers from a file using standard input. The files looks like:[详细]
2023-02-19 11:31 分类:问答Why does reading into a string buffer with scanf work both with and without the ampersand (&)?
I\'m a little bit confused about something. I was under the impression that the correct way of reading a C string with scanf() went along the lines of[详细]
2023-02-19 09:55 分类:问答C scanf() problem
Im new to C and cant for the life of me work out what im doing wrong here. The first scanf works fine, variables are printed out as they are read in. The second scanf doesn\'t seem to be reading the i[详细]
2023-02-18 22:48 分类:问答Strings taken from user in C are being scrambled
I have written the following C code to get in a list of strings from the user. But the stored strings are giving out weird values.[详细]
2023-02-18 00:06 分类:问答Warnings during compilation of some old C++ software (format expects type int, argument has int32)
I want to compile some C++ software that one can download here. It\'s from 2001. Running make should do the trick.[详细]
2023-02-17 22:53 分类:问答ignoring whitespace with sscanf in C
I have a string such as "4 Tom Tim 6", and i am trying to scan those values with sscanf like this[详细]
2023-02-17 01:35 分类:问答How to prevent menus from glitching when scanf expects an int but receives characters (C)
Take for instance: printf(\"Continue?\\n>>\"); scanf(\"%d\", &cont); getchar(); Normally I add the getchar() to prevent the program from infinite looping (reading off the \'\\n\' characte[详细]
2023-02-16 20:00 分类:问答scanf not reading input
I read more threads about scanf and I found some answers bot none helped me: while(!comanda){ int tmp; if (scanf(\"%d\", &tmp) == 0)[详细]
2023-02-16 18:01 分类:问答Getting keyboard input after fgets
I, for the life of me, cannot be at peace with c strings and input/output. For my program I simply enter a string and it gets processed in the following code: (tmpstring and ch are already defined)[详细]
2023-02-16 15:49 分类:问答