Quick Question Adding Strings and Floating point.

My question is simple.
how do i make this work.
All the variables are floating point.
And lineNum is mealy a number to assign the variable in a array.
I do brackets cause i can and cause they make me feel special lol!!
umm anyway why won't it let me add them to each other?
how would i do that?

line[LineNum+TempNum]=(Item[TempNum])+("\t")+(Price[TempNum])+("\n")+(Quantity[TempNum])+("\t")+(Total[TempNum]);

Yer it errors with
`(&Item)->std::basic_string<_CharT, _Traits, _Alloc>::operator[] [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>](((unsigned int)TempNum))' cannot be used as a function|


It's that a great error message. FREAKEN WTH looks like it's written by someone whos drunk abit to much and fallen asleep on keyboard.(Face rolling over random buttons)
Last edited on
Your code isn't much better with all the extraneous parens.

What is the type of Price, Quantity, and Total?

Your title mentions floating point... if one of those is an array of floating points (or even integers) then yes, the code won't compile because you cannot concatenate floating point or integral numbers to strings.
Topic archived. No new replies allowed.