Thank you!
Type: Posts; User: xinwu
Thank you!
Hi, all!
The code below compiled by gcc and icc behaves differently. Could anyone help me to figure the problem?
#include <stdio.h>
int main(void) {
int v[2];
int i;
Hi, everyone!
When I compile some source files, I have to always type:
gcc -I/somewhere/include -L/somewhere/lib somecode.c
Is there any way that I can configure gcc so that...
Thanks!
Does it mean that a function that returns a structure ACTUALLY returns the values of its every member?
Hi, everyone! Is it safe to let a function return a structure type? For example, which function is better in practice in the example below?
Thanks in advance!
#include <stdio.h>
struct abc...
Hi, everyone! The following code would produce -0.00000. But I want it be 0.00000. How can I do that?
int main (void) {
double a=0.0, b=-1.0;
printf("%10.5f\n", a/b);
return 0;
}
By browsing some of the others' threads, I noticed this might be one of the most difficult concept in C. And this is really important for people who are doing scientific computations, in which matrix...
Thank you for all of you!
Now, I think I understand them. To be complete of Salem's colorful elucidation.
int *[3] is an array of 3 pointers to int.
Hi, all!
I declared a two dimensional array.
int a[2][3];
I just expected 'a' is a type of 'int **'. However, a C compiler gave me the info that 'a' is a type of 'int (*)[3]'.
I'm...
Thank you!
Hi, everyone!
I've a simple question on 'printf' function. See the code below:
#include <stdio.h>
int main (void) {
printf("this \n");
printf("confused me\n"); // a breakpoint is set...
I prefer macro because I want to avoid unnecessary overhead due to function calls.
My actually definition of the macro in the program is.
#define ERROR (fmt, ...) {\
fprintf(stderr,...
Hi, everyone! I defined a macro like this:
#define POUT(format, ...) fprintf(stdout, format, __VA_ARGS__)
But at least one argument must follow the 'format' string. I want to use __VA_ARGS__...
Thank you! Now, I'm confident I understand some basic concepts in C.
Hi, everyone! The following code creates a linked list, and then free the memory for the list. I'm just a starter on C. Is the code correct? Thanks in advance!
#include <stdlib.h>
#define MAX...
To Deadplanet.
Yes, that's true! I recently found a article entitled 'Object-oriented programming in C' by Paul Field. What he was introducing and using is just what you said in your thread. I'm...