Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 02-20-2005, 06:52 PM   #1 (permalink)
Upright
 
Location: 127.0.0.1
[c++] invalid operand issue

ok, i'm working on a program for my c++ class and i think i have everything on th up 'n up but when i compile the app i get this error


Code:
invalid operands of types `const char[43]' and `float' to binary `
   operator+'
from what i can figure out it has to do with my cout << line. i think that message means that it wont let me put a string next to a float. but im not sure. what is that const char [43]'

i'll show my code if you need more, but i think i can handle this if pointed in the right direction.
7w17ch is offline  
Old 02-20-2005, 08:28 PM   #2 (permalink)
Insane
 
Without seeing the code you probably used + to concat a String with a float for output. You need to use

cout << string << float variable;

My C++ is a little rusty so I could be wrong.
username is offline  
Old 02-20-2005, 08:40 PM   #3 (permalink)
Cracking the Whip
 
Lebell's Avatar
 
Location: Sexymama's arms...
Quote:
Originally Posted by username
Without seeing the code you probably used + to concat a String with a float for output. You need to use

cout << string << float variable;

My C++ is a little rusty so I could be wrong.

No, I am finishing up c++ and that's exactly what you have to do.
__________________
"Of all tyrannies, a tyranny exercised for the good of its victims may be the most oppressive. It may be better to live under robber barons than under omnipotent moral busybodies. The robber baron's cruelty may sometimes sleep, his cupidity may at some point be satiated; but those who torment us for our own good will torment us without end, for they do so with the approval of their own conscience." – C. S. Lewis

The ONLY sponsors we have are YOU!

Please Donate!
Lebell is offline  
Old 02-21-2005, 07:25 AM   #4 (permalink)
Insane
 
Could you post your source code?? It would really help.
vinaur is offline  
Old 02-21-2005, 05:19 PM   #5 (permalink)
Upright
 
Location: 127.0.0.1
actually the first couple of posts fixed it, i had confused << with +. silly me.
7w17ch is offline  
 

Tags
invalid, issue, operand


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 04:25 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54