Thread: compiling errors

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    14

    Unhappy compiling errors

    I am a beginner in C++ programming and I am always having problems with compiling errors and what they actually mean so that I can fix it.
    my current confusion is ;
    : declaration of `length' shadows a parameter
    what does shadows mean
    Jessica

  2. #2
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    Show the code at the line where the error occurs please.

    Use [ code] [/ code] tags around your code to make it easy to read.
    Blue

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    14

    Talking compiling errors cont'd

    I put asterisks where my shadows occur.

    void getinfo(int& length, double& time, double& cost, double weekendrate, double eveningrate, double dayrate)
    {
    ifstream in;
    in.open("/home1/c/a/acsi201/samples/phonedata");
    int length;
    ** double time, cost, weekendrate = 0.15, eveningrate = 0.25, dayrate = 0.45;
    Jessica

  4. #4
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    void getinfo(int& length, double& time...

    ** double time

    That is your problem. You can't declare a double variable named time after you already declared a passed reference double named time....
    Blue

  5. #5
    Registered User
    Join Date
    Apr 2002
    Posts
    14
    Thanks I am learning this in school and the don't have a chapter on compiling errors in the book so I will be back to ask more questions when I can't figure it out for myself.
    Jessica

  6. #6
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    We will be here... come back to help people with the stuff that you learn.

    You are always welcome here... especially if you contribute.
    Blue

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. global namespace errors
    By stubaan in forum C++ Programming
    Replies: 9
    Last Post: 04-02-2008, 03:11 PM
  2. Replies: 4
    Last Post: 03-10-2008, 07:03 AM
  3. Quincy 2005: Compiling Errors
    By Thileepan_Bala in forum C Programming
    Replies: 6
    Last Post: 01-18-2008, 08:26 PM
  4. Replies: 2
    Last Post: 12-07-2004, 02:31 AM
  5. errors in my class....
    By o0obruceleeo0o in forum C++ Programming
    Replies: 9
    Last Post: 04-14-2003, 03:22 AM