programming

This is a discussion on programming within the C Programming forums, part of the General Programming Boards category; Well as you can see im new to c and its going along good sofar. I want to code something ...

  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    28

    programming

    Well as you can see im new to c and its going along good sofar. I want to code something useful or something interesting like a program that can show my systems info or something.. I am not smart, but yet im not stupid.. So i was wondering if anyone can put me on the right track


    ps

    Confused if i should of posted this on the General forum

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Here is a start:
    Code:
    #include <stdio.h>
    
    /* envp is not portable */
    int main ( int argc, char **argv, char **envp )
    {
      while ( *envp != NULL )
        puts ( *envp++ );
    
      return 0;
    }
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Feb 2004
    Posts
    28
    nice but where did you get envp from if its not declared in the header file( stdio.h )

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    envp is a common extension to the arguments that main accepts.
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Feb 2004
    Posts
    28
    Damn i would of never figured this one out.. heh thank you lets hope in the future i can still remember about this variable

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21