Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion

Go Back   Tilted Forum Project - TFP - Sexuality, Philosophy and Political Discussion > Interests > Tilted Technology

Reply
 
LinkBack Thread Tools
Old 02-20-2005, 07:52 PM   #1 (permalink)
Rookie
 
Join Date: Dec 2004
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   Reply With Quote
Old 02-20-2005, 09:28 PM   #2 (permalink)
Insane
 
Join Date: Apr 2003
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   Reply With Quote
Old 02-20-2005, 09:40 PM   #3 (permalink)
Cracking the Whip
 
Lebell's Avatar
 
Join Date: Apr 2003
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   Reply With Quote
Old 02-21-2005, 08:25 AM   #4 (permalink)
Insane
 
Join Date: Feb 2005
Could you post your source code?? It would really help.
vinaur is offline   Reply With Quote
Old 02-21-2005, 06:19 PM   #5 (permalink)
Rookie
 
Join Date: Dec 2004
Location: 127.0.0.1
actually the first couple of posts fixed it, i had confused << with +. silly me.
7w17ch is offline   Reply With Quote
Reply

Bookmarks

Tags
invalid, issue, operand

Thread Tools

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
Forum Jump


All times are GMT -7. The time now is 02:26 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
All text (c) 2002-2008 Tilted Forum Project
"Insignia" vBulletin 3.5 - b6gm6n - x7x7x7.com