Search:

Type: Posts; User: brassbin

Search: Search took 0.01 seconds.

  1. Replies
    14
    Views
    2,432

    the word "stack" has been mentioned multiple...

    the word "stack" has been mentioned multiple times in this thread, would really appreciate if someone could explain in detail? does this have anything to do with compile-time allocation vs. run-time...
  2. Replies
    14
    Views
    2,432

    Salem, would you mind elaborate on that? what is...

    Salem, would you mind elaborate on that? what is this "stack" you were referring to?
  3. Replies
    14
    Views
    2,432

    variable length array

    this code snippet compiles and runs fine


    #include <stdio.h>

    int main(void) {
    int i, a[i];


    i=2;
  4. Thank you!

    Thank you!
  5. using scanf() to read a character from standard input

    so running the following code



    #include <stdio.h>

    int main(void) {
    char c;
    int i=1;
  6. thank you! that worked, may i ask why it had to...

    thank you! that worked, may i ask why it had to be an explicit comparison? wouldn't implicit conversion take care of the returning "int" value of scanf() to a TRUE, and only errors such as EOF to...
  7. linux on a PC

    linux on a PC
  8. Ctrl+Z just backgrounds it

    Ctrl+Z just backgrounds it
  9. how to signal end of standard input using scanf()

    so i'm using scanf() this way



    int i;

    while (scanf("%i", &i))
    printf("%i ", i);
    printf("\ndone\n");
  10. Replies
    8
    Views
    2,278

    Thank you all very much for your help!...

    Thank you all very much for your help!
    anduril462, just want to say this, i'm telling myself as i type up this reply, that i shouldn't expect my future questions to be answered with this level of...
  11. Replies
    8
    Views
    2,278

    i apologize, the actual code i was compiling with...

    i apologize, the actual code i was compiling with has more lines to it, i thought i dump it down to simplify the question, could you try with these 2 code samples, the gcc version shows 4.4.7

    ...
  12. Replies
    8
    Views
    2,278

    a question on the use of pow() function

    so i had code "test.c" like this


    #include <stdio.h>
    #include <math.h>

    int main(void) {
    float f;
    f=pow(2.1, 2);
    printf("f is %f\n", f);
  13. Replies
    8
    Views
    983

    Thank you all for your help!

    Thank you all for your help!
  14. Replies
    8
    Views
    983

    i kind of understand what you are saying :-) that...

    i kind of understand what you are saying :-) that "%f" is merely a formatting string, and that's how C does things, but still if you just read the above quoted, it's quite ambiguous, and that's the...
  15. Replies
    8
    Views
    983

    why doesn't integer to float conversion kick in...

    why doesn't integer to float conversion kick in here


    printf("%f", 1)

    it kicks in here


    float f;
    int x=3, y=2;
  16. Replies
    8
    Views
    983

    i'm trying to understand how the float/integer...

    i'm trying to understand how the float/integer conversion mechanism works here, i intentionally made up the code like that, i was expecting "1.000000", in fact i had something like


    float f;
    f =...
  17. Replies
    8
    Views
    983

    float/integer conversion question

    why does the following code output "0.000000" instead of "1.000000"?


    #include <stdio.h>

    int main(void) {
    int x=3, y=2;
    printf("3/2 is %f\n", x/y);
    return 0;
    }
Results 1 to 17 of 17