Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3042

[RESOLVED] I don't understand why my code is not printing correctly

$
0
0
My program is only printing this:

of x is

It should be printing:

The value of x is

I don't get it. My code looks okay. The partial code is this:

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
int x;

x = 10;

if (x == 10)
{
int y;

cout << "The value of x is " + x;
}
system("pause");

return 0;
}

Viewing all articles
Browse latest Browse all 3042

Trending Articles