Jump to content

c++ programming question


P@c_M@n
 Share

Recommended Posts

I just got into c++ and im having a bit of trouble with the programming. But theres this one thing with my programming that my c++ complier doesn't seem to allow. Theres this line of code in my program that my compiler classifies as an error. This is it:

cout << "Hi there!" << end1; //end1=next line

this is the whole code:

#include <iostream>

using namespace std;

int main(int argc, char* argv[])

{

//Without "using" statement, this would be std::cout

cout << "Hi there!" << end1; // "end" =next line

return 0;

}

I also made another code meant to perform a calculation. But it had the same problem as this. I originally used the program dev C++ and i also tried a program called CodeBlocks. Both display the same error. Can anyone tell me whats wrong with my code?

Link to comment
Share on other sites

I just got into c++ and im having a bit of trouble with the programming. But theres this one thing with my programming that my c++ complier doesn't seem to allow. Theres this line of code in my program that my compiler classifies as an error. This is it:

cout << "Hi there!" << end1; //end1=next line

this is the whole code:

#include <iostream>

using namespace std;

int main(int argc, char* argv[])

{

//Without "using" statement, this would be std::cout

cout << "Hi there!" << end1; // "end" =next line

return 0;

}

I also made another code meant to perform a calculation. But it had the same problem as this. I originally used the program dev C++ and i also tried a program called CodeBlocks. Both display the same error. Can anyone tell me whats wrong with my code?

It looks incredibly much like you are using the number one instead of a lowercase L.

I find

cout << "Hello there!\n";

easier to read.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...