Top "C" questions

C is a general-purpose programming language used for system programming (OS and embedded), libraries, games and cross-platform.

How do you get assembler output from C/C++ source in gcc?

How does one do this? If I want to analyze how something is getting compiled, how would I get the …

c++ c debugging gcc assembly
How to clear input buffer in C?

I have the following program: int main(int argc, char *argv[]) { char ch1, ch2; printf("Input the first character:"); // Line 1 …

c buffer
C programming in Visual Studio

Can I use Visual Studio to learn C programming? In the new project menu I can choose between Visual Basic, …

c visual-studio
Removing trailing newline character from fgets() input

I am trying to get some data from the user and send it to another function in gcc. The code …

c string gcc newline fgets
Difference between a Structure and a Union

Is there any good example to give the difference between a struct and a union? Basically I know that struct …

c struct unions
"static const" vs "#define" vs "enum"

Which one is better to use among the below statements in C? static const int var = 5; or #define var 5 or …

c constants
Printing hexadecimal characters in C

I'm trying to read in a line of characters, then print out the hexadecimal equivalent of the characters. For example, …

c hex printf
How do you allow spaces to be entered using scanf?

Using the following code: char *name = malloc(sizeof(char) + 256); printf("What is your name? "); scanf("%s", name); printf("Hello %s. …

c string printf scanf whitespace
Convert an int to ASCII character

I have int i = 6; and I want char c = '6' by conversion. Any simple way to suggest? EDIT: also …

c++ c ascii
How does strtok() split the string into tokens in C?

Please explain to me the working of strtok() function. The manual says it breaks the string into tokens. I am …

c string split token strtok