Top "C" questions

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

What should main() return in C and C++?

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void …

c++ c return-value main return-type
What is the difference between char s[] and char *s?

In C, one can use a string literal in a declaration like this: char s[] = "hello"; or like this: char *…

c string char constants
Returning an array using C

I am relatively new to C and I need some help with methods dealing with arrays. Coming from Java programming, …

c arrays pointers char
Regular expressions in C: examples?

I'm after some simple examples and best practices of how to use regular expressions in ANSI C. man regex.h …

c regex
How to know what the 'errno' means?

When calling execl(...), I get an errno=2. What does it mean? How can I know the meaning of this errno?

c linux errno
What does the question mark and the colon (?: ternary operator) mean in objective-c?

What does this line of code mean? label.frame = (inPseudoEditMode) ? kLabelIndentedRect : kLabelRect; The ? and : confuse me.

objective-c c syntax operators conditional-operator
How do I trim leading/trailing whitespace in a standard way?

Is there a clean, preferably standard method of trimming leading and trailing whitespace from a string in C? I'd roll …

c string whitespace trim
Convert Python program to C/C++ code?

is it possible to convert a Python program to C/C++? I need to implement a couple of algorithms, and …

c++ python c code-generation
How do I detect unsigned integer multiply overflow?

I was writing a program in C++ to find all solutions of ab = c, where a, b and c together …

c++ c integer-overflow
Creating your own header file in C

Can anyone explain how to create a header file in C with a simple example from beginning to end.

c header include include-guards c-header