Top "C" questions

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

What is the purpose of using -pedantic in GCC/G++ compiler?

This note says: -ansi: tells the compiler to implement the ANSI language option. This turns off certain "features" of GCC …

c++ c gcc g++
String in function parameter

int main() { char *x = "HelloWorld"; char y[] = "HelloWorld"; x[0] = 'Z'; //y[0] = 'M'; return 0; } In the above program, HelloWorld will be …

c gcc string-literals function-parameter
A free tool to check C/C++ source code against a set of coding standards?

It looks quite easy to find such a tool for Java (Checkstyle, JCSC), but I can't seem to find one …

c++ c coding-style
error: function returns address of local variable

I'm beginner with C and I am learning on my own. I am creating the following function: char *foo(int …

c return strcpy strcat
What is "Signal 15 received"

What might cause a C, MPI program using a library called SUNDIALS/CVODE (a numerical ODE solver) running on a …

c linux mpi ode
Is the sizeof(some pointer) always equal to four?

For example: sizeof(char*) returns 4. As does int*, long long*, everything that I've tried. Are there any exceptions to this?

c++ c pointers memory sizeof
How to pass macro definition from "make" command line arguments (-D) to C source code?

I usually pass macro definitions from "make command line" to a "makefile" using the option : -Dname=value. The definition is …

c macros makefile
Faster way to zero memory than with memset?

I learned that memset(ptr, 0, nbytes) is really fast, but is there a faster way (at least on x86)? I …

c libc
Is there a Java equivalent or methodology for the typedef keyword in C++?

Coming from a C and C++ background, I found judicious use of typedef to be incredibly helpful. Do you know …

java c++ c design-patterns typedef
How do I execute a file in Cygwin?

How can I execute a.exe using the Cygwin shell? I created a C file in Eclipse on Windows and …

c gcc cygwin