Each variable in C has a specific type, which determines the size and layout of the variable's memory the range of values that can be stored within that memory and the set of operations that can be applied to the variable. One of the primitive data types is an int eger, as we glossed over in the previous tutorial when talking about the 'main' function. To declare a variable in C, we write the data-type that we want the variable to contain, followed by the variable's name, followed by a semicolon. What are the differences between a pointer variable and a reference variable in C? Initially, the user input is captured in a char variable like this: char response 256 = ' printf ('Please enter a menu selection (1 - 14): ') fgets (response, 256, stdin) If the user inputs incorrectly, the same function gets called, but I am having a problem where the initial (incorrect) enter never goes away. (const'd somehow) that you can use in C string functions. Ask Question Asked 7 years, 3 months ago.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |