Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Please check the C code

  1. #11
    Junior Member
    Join Date
    Nov 2002
    Posts
    3
    #include <stdio.h>

    int main ()
    {
    int i;
    printf("%d" ,i );

    }

    This is what i got after compileing and rubnning your code:-1073744680

    it's probly some junk address somewhere in memory that the compiler spit up.

    sincere.

    Originally posted here by Phactorial
    mathgirl32, why do you keep making yourself look like an idiot? He is not testing us, he is actually asking a very interesting question if you knew atleast half of what you talk about.

    harbir: This depends on how the compiler loads int i into memory and how the operating system deals with memory management. On most machines, this will print out what could be considered a kind of "random junk". Since int i will be on the stack (meaning, it will be using memory which was probably used by another program), when you printf %d it would output the value of the stack where int i is.
    Well said, I believe you might br correct.

    Sincere.

  2. #12
    Senior Member
    Join Date
    Jul 2002
    Posts
    744
    It's okay mathgirl, I'll still be your friend. . .he has been posting a lot of stuff like this lately, though.
    Every now and then, one of you won't annoy me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •