Help me C++

Look at the error, find the line and columb, work it out. Easier for you to find the error than for me to exam every bit of your code for one error. This sort of thing happens all the time and you need to learn how to find your mistake

I wonder, would auto fix this? (As an alternative solution for the obvious one) Though obviously you'd want to understand the reason the current code doesn't work.

I'm in Visual Studio, and right after "Hello my name is" the << is red underlined, and when i hover over it, it says

no operatior << matches these operands

You probably need #include <string>. It should tell you that when you try to compile and run the code.

1 Like

Yep, that fixed that part.

now, i may have to read my book some more because Im not positive the

address variable i made can have other string variables combined using addition...

Read up on the string include as well.

On your thought there, can you combine your variable zip (int) with the rest (string)?

The best way to check might be to make some code example and run them.

Lol yea Im on chapter 4, so far my class is on chapter 2... , so strings have not yet been introduced.

I found a lazy solution to the last question...

#include <iostream>
using namespace std;

int main()
{
	cout << "Dick Jones\n123 Street St Detroit Michigan 0893112\n1230666633\nComputer Science" <<endl;


	cin.get(); //stops result screen (console)
	return 0;
}

result

Dick Jones
123 Street St Detroit Michigan 0893112
1230666633
Computer Science

You might be missing the point of the exercise though, which I think is to learn how to handle different variable types together.

You can build a MPG program to deal with a car, truck, train, spaceship if you deals with the inputs and the outputs. Use common sence not what works,,,,what works breaks code next year,

2 Likes