compiler error

This is a discussion on compiler error within the C++ Programming forums, part of the General Programming Boards category; what does this compiler error (Borland) mean: Lvalue required in function main()...

  1. #1
    mrukok
    Guest

    compiler error

    what does this compiler error (Borland) mean:

    Lvalue required in function main()

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    well, without seeing the code, I cannot understand too much.

  3. #3
    mrukok
    Guest
    heres an example code that causes this error:

    <code>
    string strng[5];
    char arry[5];

    strng[2] = "Howdy";

    arry = strng[2];

    cout << arry;
    </code>

  4. #4
    mrukok
    Guest
    this is the problem line:

    Code:
    arry = strng[2];
    but whats the problem?

  5. #5
    ! |-| /-\ +3 1337 Yawgmoth's Avatar
    Join Date
    Dec 2002
    Posts
    187
    You need to put a number by arry, eg:

    Code:
    arry[2]=strng[2];
    L33t sp3@k sux0rz (uZ it t@k3s 10 m1|\|ut3s 2 tr@nzl@te 1 \/\/0rd & th3n j00 h@\/3 2 g3t p@$t d@ m1zpelli|\|gz, @tr0(i0u$ gr@mm@r @|\|d 1n(0/\/\pr3#3|\|$1bl3 $l@|\|g. 1t p\/\/33nz j00!!

    Speling is my faverit sujekt

    I am a signature virus. Add me to your signature so that I may multiply.

  6. #6
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Or if strng is an array of strings,

    Code:
    strcpy( array, strng[2] );
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  7. #7
    mrukok
    Guest
    Or if strng is an array of strings,

    Code:
    strcpy( array, strng[2] );
    how's that supposed to work?

    i tried it and it said
    "could not find a match for 'strcpy(char *, string)'"

  8. #8
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Code:
    strcpy( array, strng[2].c_str( ) );
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  9. #9
    mrukok
    Guest
    wow that worked! thanks..
    but what does the last bit mean?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 03:35 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  3. error: template with C linkage
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 08:11 AM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 09:43 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM

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