Thread: structs tutorial question?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User code2d's Avatar
    Join Date
    Nov 2006
    Location
    Canada
    Posts
    87

    structs tutorial question?

    Im compiling in dev c++ 5 beta

    Code:
    #include <iostream>
    
    struct database {
      int id_number;
      int age;
      float salary;
    };
    
    int main()
    {
      database employee;  //There is now an employee variable that has modifiable 
                          // variables inside it.
      employee.age = 22;
      employee.id_number = 1;
      employee.salary = 12000.21;
    return 0;
    }
    When I compile and run, it boot's the console app window and then exits.
    I believe its just my bad beginners programming.
    Last edited by code2d; 01-06-2007 at 11:57 PM.
    Compiler in use: MinGW

    OS: Windows ME

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Structs Question
    By DarkDot in forum C++ Programming
    Replies: 3
    Last Post: 04-04-2007, 01:10 PM
  2. tutorial quizz question for switch operator
    By asem0525 in forum C Programming
    Replies: 7
    Last Post: 11-18-2006, 05:56 PM
  3. Question about small tutorial closing
    By Matamoros123 in forum C++ Programming
    Replies: 3
    Last Post: 10-06-2006, 09:55 AM
  4. Problem with tutorial (Vector class)
    By OdyTHeBear in forum C++ Programming
    Replies: 4
    Last Post: 12-18-2002, 02:49 PM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM