Thread: Problem with in, "cout" (Each "endl"

  1. #1
    C++, using Dev C++
    Join Date
    May 2004
    Posts
    7

    Problem with in, "cout" (Each "endl"

    Hi,

    i have problem to compile a sourcecode...

    error with "Cout"
    error with in
    error with (Each
    error with "endl"
    What have I did wrong in this code...

    Code:
    #include <iostream>
    
    struct  TIME_REC
    {
        double   dHours;
        double   dRate;
    };
    
    int main()
    {
        TIME_REC    payrollRecord;
    
        payrollRecord.dHours = 40.0;
        payrollRecord.dRate = 3.75;
    
        cout << "This week's payroll information:" << endl;
        cout << "Hours worked : " << payrollRecord.dHours << endl;
        cout << "Rate         :$" << payrollRecord.dRate  << endl;
    
        double dSalary = payrollRecord.dRate * payrollRecord.dHours;
        cout << "Salary       :$" << dSalary  << endl;
    
        return 0;
    }

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Code:
    #include <iostream>
    
    using namespace std; // Add this
    
    struct  TIME_REC
    {
        double   dHours;
        double   dRate;
    };
    
    int main()
    {
        TIME_REC    payrollRecord;
    
        payrollRecord.dHours = 40.0;
        payrollRecord.dRate = 3.75;
    
        cout << "This week's payroll information:" << endl;
        cout << "Hours worked : " << payrollRecord.dHours << endl;
        cout << "Rate         :$" << payrollRecord.dRate  << endl;
    
        double dSalary = payrollRecord.dRate * payrollRecord.dHours;
        cout << "Salary       :$" << dSalary  << endl;
    
        return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM