Results 1 to 3 of 3

Thread: weird error in VC++ 5

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59

    Angry

    In my school, we're learning C++ in VisualC++, but we're not doing the visual aspect, just the console commands and stuff... I have a program I've written to basically tell how much money someone lost or gained in a stock program... When i go to compile, i get this error:
    There is no context in which tis conversion is possible
    does anyone know what this means?

  2. #2

    Thread Starter
    Member
    Join Date
    Sep 1999
    Location
    Westfield, IN, USA
    Posts
    59
    I thought I'd attach my current source code
    Attached Files Attached Files

  3. #3
    Hyperactive Member JazzBass's Avatar
    Join Date
    Jun 1999
    Posts
    393

    I think I have it

    Hi,

    I think it's because of this:

    Code:
    ...
    float gained_lost;
    ...
    Since you made gained_lost a float, you can only give it a number. Later on down when you do the if statement it checks for a char or string.

    When you assign gained_lost a value, just give it a number like 0 or 1; not "0" or "1".

    Hope that makes sense.

    Let is know.

    JazzBass
    JazzBass
    In the .NET era
    Trying to remember VB6
    Progress:
    XP Professional @ Home
    and @ the Office

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width