Search:

Type: Posts; User: xinwu

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    983

    Thank you!

    Thank you!
  2. Replies
    4
    Views
    983

    a bug of gcc, or a bug of mine?

    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;
  3. Replies
    2
    Views
    923

    A question on 'gcc'

    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...
  4. Replies
    3
    Views
    6,091

    Thanks! Does it mean that a function that...

    Thanks!
    Does it mean that a function that returns a structure ACTUALLY returns the values of its every member?
  5. Replies
    3
    Views
    6,091

    A function returns a structure

    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...
  6. Replies
    11
    Views
    2,513

    Zero divided by minus one

    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;
    }
  7. Replies
    7
    Views
    1,112

    By browsing some of the others' threads, I...

    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...
  8. Replies
    7
    Views
    1,112

    Thank you for all of you! Now, I think I...

    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.
  9. Replies
    7
    Views
    1,112

    a question on two dimensional array

    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...
  10. Replies
    2
    Views
    1,048

    Thank you!

    Thank you!
  11. Replies
    2
    Views
    1,048

    a question on 'printf'

    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...
  12. Replies
    4
    Views
    7,803

    I prefer macro because I want to avoid...

    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,...
  13. Replies
    4
    Views
    7,803

    __VA_ARGS__ with empty argument.

    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__...
  14. Replies
    2
    Views
    14,318

    Thank you! Now, I'm confident I understand some...

    Thank you! Now, I'm confident I understand some basic concepts in C.
  15. Replies
    2
    Views
    14,318

    free the memory of linked list.

    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...
  16. Replies
    6
    Views
    6,977

    To Deadplanet. Yes, that's true! I recently...

    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...
Results 1 to 16 of 16