Top "C" questions

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

Arrow operator (->) usage in C

I am reading a book called "Teach Yourself C in 21 Days" (I have already learned Java and C# so I …

c pointers syntax
'float' vs. 'double' precision

The code float x = 3.141592653589793238; double z = 3.141592653589793238; printf("x=%f\n", x); printf("z=%f\n", z); printf("x=%20.18f\n", …

c floating-point
Get the current time in C

I want to get the current time of my system. For that I'm using the following code in C: time_…

c time time-t localtime
Check substring exists in a string in C

I'm trying to check whether a string contains a substring in C like: char *sent = "this is my sample example"; …

c string
Preventing console window from closing on Visual Studio C/C++ Console application

This is a probably an embarasing question as no doubt the answer is blindingly obvious. I've used Visual Studio for …

c visual-studio console
What does "collect2: error: ld returned 1 exit status" mean?

I see the error collect2: error: ld returned 1 exit status very often. For example, I was executing the following snippet …

c compiler-errors
How to do scanf for single char in C

In C: I'm trying to get char from the user with scanf and when I run it the program don't …

c char scanf
Execution time of C program

I have a C program that aims to be run in parallel on several processors. I need to be able …

c benchmarking
How do I properly compare strings in C?

I am trying to get a program to let a user enter a word or character, store it, and then …

c string strcmp
Stack smashing detected

I am executing my a.out file. After execution the program runs for some time then exits with the message: **** …

c exception stack