Nanor
Well-Known Member
I'm starting to learn C++ as I'm undoubtedly going to need it later on in my career, and I'm using a guide that elDiablo kindly posted me Teach Yourself C++ in 21 Days. Now, that's great and I'm coming on nicely, but if you look at an example of any of the code, you'll see it looks like this:
Don't worry about what the code does, it just tells the size of integers and characters et cetera, but what annoys me is the numbers down the left hand side of the code, when I copy and paste that code above into my compiler, it doesn't recognise those numbers as something to tell me what line it is.
Instead of editing all the numbers out, or putting /* */'s around them I'd like to be able to copy and paste without selecting those. If you open command prompt, right click and select mark, that allows you to highlight text there, but not the same way as browsers and I was wondering if there was a way to do that in browsers? I'd be most appreciative if you could tell me how.
Code:
1: #include <iostream.h>
2:
3: int main()
4: {
5: cout << "The size of an int is:\t\t" << sizeof(int) << " bytes.\n";
6: cout << "The size of a short int is:\t" << sizeof(short) << " bytes.\n";
7: cout << "The size of a long int is:\t" << sizeof(long) << " bytes.\n";
8: cout << "The size of a char is:\t\t" << sizeof(char) << " bytes.\n";
9: cout << "The size of a float is:\t\t" << sizeof(float) << " bytes.\n";
10: cout << "The size of a double is:\t" << sizeof(double) << " bytes.\n";
11:
12: return 0;
13: }
Don't worry about what the code does, it just tells the size of integers and characters et cetera, but what annoys me is the numbers down the left hand side of the code, when I copy and paste that code above into my compiler, it doesn't recognise those numbers as something to tell me what line it is.
Instead of editing all the numbers out, or putting /* */'s around them I'd like to be able to copy and paste without selecting those. If you open command prompt, right click and select mark, that allows you to highlight text there, but not the same way as browsers and I was wondering if there was a way to do that in browsers? I'd be most appreciative if you could tell me how.