strings to numbers

I am trying to input two numbers as c strings, it should be 4 digits long
and should contain no letters.
This code gives me C3687 and C2446 errors.
I am trying to print which numbers are too large or small (see comments)
but not sure how.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// string_numbers.cpp : enter two numbers as c strings, if the digits aren't four, or letters are contained
						//raise error message.

#include "pch.h"
#include <iostream>
#include<string>

using namespace std;

void enter_numbers(string a, string b)
{
	
	char answer;
		do{
			
			if ((a.size > 4) || (b.size > 4)) 
			{
				cout << "number too large (max 4 digits)" << endl; // I would like to print which number is the 
																	//one too large, but not sure how
		
			}
			else if ((a.size <4) || (b.size<4))
			{
				cout << "number too small (min 4 digits)" << endl; // I would like to print which number is the 
																	//one too small, but not sure how
			}
			for (int i = 0; i <= a.length; i++)
			{
				if ( (isdigit(a[i]) or (isdigit(b[i]))) == false) 
				{
					cout << "only digits allowed" << endl;
					break;
				}
				
			}

			cout << "try again(Y/N)?" << endl;
			cin >> answer;

		} while (answer == 'Y' || answer == 'y');

}

int main()
{
	
	string y, z;
	int m = stoi(y);
	int n = stoi(z);
	cout << "enter the first number" << endl;
	cin >> y ;
	cout << "enter the second number" << endl;
	cin >> z ;

	enter_numbers(y,z);

	cout << m + n << endl;

	return 0;
}
@mcgrim8

I don't know if this will make your program fully workable, as I haven't tried compiling or anything, but you do have a problem with lines 48 and 49. Those two lines should be moved to after line 55, since variables y and z contain NOTHING at first creation, m and n will also contain garbage values. Also, how is enter_numbers(y,z); going to return any value, since you declared the function as void?
I've applied the changes you suggested, but now I get the same kind of errors, but in more lines.

For the future: Telling us particular error codes "C3687" is not helpful. [It's not your fault, I don't know why Visual Studio decides to make those code numbers be the first thing people see.]

What helps is if you provide the text of the error message itself.

When I try to compile your code, I get error: invalid use of member function (did you forget the '()' ?) with the line in question being if ((a.size > 4) || (b.size > 4))
Looks like GCC is even smart enough to give a suggestion: You forgot to use () to call a member function. size is a member function of std::string.
Last edited on
1
2
3
4
5
6
7
8
9
10
11
	string y,z;
	//input y, z
	int m=stoi(y), n= stoi(z);
	if(m>9999 || m<1000 || n> 9999 ||  n<1000)
	{
		//print error
	}
	else
	{
		//code
	}
Hello mcgrim8,

There are many problems with your code.

#include "pch.h" . This line you do not need to include when posting code here. This is only used be VS and may only work on your computer. Creating an empty solution/project will eliminate the need for this file.

The function "enter_numbers" would be better called "checkNumbers" as you enter nothing in the function, but you do check what was entered.

(a.size > 4). Looking at this it appears that you are trying to access something in a class or a struct. As Ganado mentioned and to expand on this ".size" and ".length" are member functions of, in this case, the string class. They are also member functions of other classes. The proper use would be a.size() and b.size().

Note: ".size()" and .length()" are the same as they both return amount of elements in the string or whatever they are use for. The other part to keep in mind is that each return a "size_t" variable type. "size_t" and on occasion "size_type" are both "typedef"s for an "unsigned int".

The problem with lines 16, 22 and 27 is that you are comparing an "unsigned int" to a "signed int". Not enough to stop the program, but enough for a warning.

One way around this and a better choice than using "magic numbers" is before the function put
constexpr size_t MAXSIZE{ 4 };. Then in the lines 16, 22 and 27 in place of the (4) use "MAXSIZE". If someday the (4) should ever change you only have to do it in one place and it will affect everywhere you use "MAXSIZE".

In line 29 you used the word "or" when you should have used "||". Was this a brain an you forgot what you did in lines 16 and 22?

Inside "main" line 47 defines two variables of type "std::string". As you have defined them they are empty and have no length. On lines 48 and 49 there is nothing to change into an "int". These lines are better placed after the call to "checkNumbers", so that you know that what is in the string is something that will convert into an "int".

These changes should get the code to compile.

Running the program is a different story.

The function that should be "checkNumbers" does not work. The do/while loop is not needed as there is no reason to loop the function. All the function should do is check the string. And you should check each after it is entered. Meaning that the function should have only one parameter.

Rather than trying to explain all the changes look this over and if you have any questions let me know.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include<string>

//using namespace std;  // <--- Best not to use.

constexpr size_t MAXSIZE{ 4 };

bool checkNumbers(std::string number)
{
	bool good{ true };

	if ((number.size() > MAXSIZE))
	{
		std::cout << "\n    Number too large (max 4 digits)\n" << std::endl; // I would like to print which number is the 
		good = false;                                      // one too large, but not sure how

	}
	else if ((number.size() < MAXSIZE))
	{
		std::cout << "\n    Number too small (min 4 digits)\n" << std::endl; // I would like to print which number is the 
		good = false;                                      // one too small, but not sure how
	}

	if (good) // <--- Only check if the number is four digits.
	{
		for (size_t i = 0; i < MAXSIZE; i++) // <--- Using "<=" will put you past the length of the string. And at this point the string should be a length or size of four.
		{
			if (!(isdigit(number[i])))
			{
				std::cout << "\n     Only digits allowed\n" << std::endl;
				good = false;
			}
		}
	}

	return good;
}

int main()
{
	bool goodNum1{ false }, goodNum2{ false };
	std::string y{ "123A" }, z{ "567B" };
	int m{};
	int n{};

        // <--- Uncomment when finished testing.
	//std::cout << "enter the first number" << endl;
	//std::cin >> y;
	//std::cout << "enter the second number" << endl;
	//std::cin >> z;

        // <--- This part used for testing. Comment out or remove when finished using.
	std::cout << "\n Enter the  first number: " << y << '\n';
	goodNum1 = checkNumbers(y);  // <--- Needs to be copied the the above section.

	std::cout << " Enter the second number: " << z << '\n';
	goodNum2 = checkNumbers(z);  // <--- Needs to be copied the the above section.

	if (goodNum1)
		if (goodNum2)
		{
			m = stoi(y);
			n = stoi(z);

			std::cout << "\n The product of m + n = " << m + n << std::endl;
		}

	return 0;
}


Hope that helps,

Andy
Handy Andy wrote:
In line 29 you used the word "or" when you should have used "||". Was this a brain an you forgot what you did in lines 16 and 22?

It's perfectly legal to use and and or instead of && and ||.
@Mikey Boy,

Thanks for the input I did not realize that. I will have to give it a try soon.

In what you quoted I did mean to say "brain freeze" before I got to far ahead of my self missing the work "freeze".

Andy
Hello mcgrim8,

I did end up making some changes after I posted the message yesterday.

"main" now looks like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
int main()
{
	bool goodNum1{ false }, goodNum2{ false };
	std::string numStr1{ "1234" }, numStr2{ "5678" }; // <--- Remove the {} and the number inside when done testing.
	int num1{}, num2{};

/* ******************************************************************* */
	//std::cout << "enter the first number: " << endl;
	//std::cin >> numStr1;
	//goodNum1 = checkNumbers(numStr1);

	//if (goodNum1)
	//{
	//	std::cout << " Enter the second number: " << numStr2 << '\n';
	//	goodNum2 = checkNumbers(numStr2);
	//}
/* ******************************************************************* */

	// <--- Swap comments when done testing.

/*  ****************************************************************** */
	std::cout << "\n Enter the  first number: " << numStr1 << '\n';
	goodNum1 = checkNumbers(numStr1);  // <-- Check after entering each number.

	if (goodNum1)  // <--- continue only if first number is good.
	{
		std::cout << " Enter the second number: " << numStr2 << '\n';
		goodNum2 = checkNumbers(numStr2);
	}
/* ******************************************************************* */
	if (goodNum1 and goodNum2)  // <--- Trying suggestion from "Mikey Boy"
	{
		num1 = stoi(numStr1);
		num2 = stoi(numStr2);

		std::cout << "\n The product of " << num1 << " + " <<num2 << " = " << num1 + num2 << std::endl;  // <--- Changed.
	}

	// The next line may not be needed. If you have to press enter to see the prompt it is not needed.
	//std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');  // <--- Requires header file <limits>. Uncomment for normal run.
	std::cout << "\n\n Press Enter to continue :";
	std::cin.get();

	return 0;
}

Anything that you do not understand let me know.

Until today I have always had the understanding that && and || is what was needed when doing a logical comparison. Now I know different.

One thing I missed mentioning earlier is to use better variable names than a single letter. It is not a big problem in a program this small, but in a larger program with several hundred lines it is harder to keep track of the single letters. Something more descriptive makes the code easier to read.

Hope that helps,

Andy
looks like you want size==4 else can't be valid. Is it worth the code bloat and processing to generate distinct errors for too big vs too small or just tell them its 4 digits and theirs was invalid?
Last edited on
thank you all for your help, and especially Handy Andy for so much coding.
I kept my code and changed the purpose a bit, by giving the string a maximum 4 digits and no minimum, and it works.
However, I am trying to implement the 'only digits' feature in it, but I am having an hard time doing so, as my code happens to sum the numbers anyway and sometimes it blocks without giving me an error.
Let me please know how to include this, and if possible, I would like to use the 'isdigit' option.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// string_numbers.cpp : enter two numbers as c strings, if the input is more than 4 digits, or letters are contained
						//raise error message.

#include "pch.h"
#include <iostream>
#include<string>

using namespace std;

void enter_numbers(string a, string b)
{
	int m = stoi(a);
	int n = stoi(b);

	for (int i = 0; i <= 1; i++)
	{
		if (!isdigit(a[i]) || !isdigit(b[i]))
		{
			cout << "input not valid (only digits allowed)" << endl;
		}
}
	for (int j =1; j <= 1; j++)
	{
		if (a.size() > 4 && b.size() <=4)
		{
			printf("%d too large (max 4 digits)\n", m);
			break;
		}
		else if (b.size() > 4 && a.size()<=4)
		{
			printf("%d too large (max 4 digits)\n", n);
			break;
		}
		else if (a.size() & b.size() > 4)
		{
			printf("%d and %d are too large (max 4 digits)\n", m, n);
		}
		else 
		{
			cout << "the sum is "<< m+n << endl;
		}
	}
	}


int main()
{
	char answer;
	do
	{
		string y, z;


		cout << "enter the first number" << endl;
		cin >> y;
		cout << "enter the second number" << endl;
		cin >> z;

		enter_numbers(y, z);
		
		cout << "try again(Y/N)?" << endl;
		cin >> answer;
} while (answer == 'Y' || answer == 'y');
		
	return 0;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#define MAXNUMCHAR (int)'9'
#define MINNUMCHAR  (int)'0'

bool isDigit(string a){
   for(int i = 0;a[i] != '\0';i++){
      if((int)a[i] > MAXNUMCHAR || (int)a[i] < MINNUMCHAR){
         return false;
      }
   }
   return true;
}

bool toBig(string a){
   if(a[4] != '\0'){
      return true;
   }
   return false;
}

int main(){
   string input;
   cin >> input;
   if(!isDigit(input) || toBig(input)){
      cout << "improper input\n";
   }
   else{
      //whatever yer fine XD
   }
}

That should work :P

EDIT >> though if you really want to nitpick, there is a 1/128 % chance that the toBig() func will malfunction if the input is too small.
Last edited on
I rewrote my code and It almost works,
I only have a couple of issues:

1- this line: "invalid input, please enter digits only!"
is printed after every trial, no matter what I input.

2- The numbers are summed anyway, but I don't want that.

3- I would like the program to try the whole input again as soon as the input does not
follow the criteria (not enough digits, extra characters etc...) without having to input
both numbers anyway before I obtain the feedback.

4- would it be possible for any of you to correct my code instead of writing an entire new one?
Unfortunately, when It comes to coding, I understand my own a lot more and usually struggle in reading others work.

5- Dear Handy andy, you said above that you disagree with writing "using namespace std".
Can you please tell me why? As far as I can see, you don't use this line but you write std before all lines instead. Isn't it too much unnecessary work or is there anything important that I am missing.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <iostream>
#include<string>
#include<conio.h>

using namespace std;

void enter_numbers(string a, string b)
{
	
	int m = stoi(a);
	int n = stoi(b);
	int max = 0;

	

	if (a.size() >= b.size())
	{
		max = a.size();
	}
	else
	{
		max = b.size();
	}

	for (int i = 0; i < max; ++i)
	{
		if (!isdigit(a[i] || b[i]))
		{
			cout << "invalid input, please enter digits only!" << endl;
			break;
		}
	}

	for (int j = 1; j <= 1; j++)
	{
		if (a.size() > 4 && b.size() <=4)
		{
			printf("%d too large (max 4 digits)\n", m);
			break;
		}
		else if (b.size() > 4 && a.size()<=4)
		{
			printf("%d too large (max 4 digits)\n", n);
			break;
		}
		else if (a.size() & b.size() > 4)
		{
			printf("%d and %d are too large (max 4 digits)\n", m, n);
		}
		else 
		{
			cout << "the sum is "<< m+n << endl;
		}
	}
}

int main()
{
	char answer;
	do
	{
		string y, z;


		cout << "enter the first number" << endl;
		cin >> y;
		cout << "enter the second number" << endl;
		cin >> z;

		enter_numbers(y, z);
		
		cout << "try again(Y/N)?" << endl;
		cin >> answer;
} while (answer == 'Y' || answer == 'y');
		
	return 0;
}
dear highwayman,

Thanks for your code, but I am not sure how to implement it into my function.
Ok I’m assuming that the posted code right above me is your new code, I’ll try and show how to incorporate mine:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#include <iostream>
#include<string>
#include<conio.h>

using namespace std;

#define MAXNUMCHAR (int)'9'
#define MINNUMCHAR  (int)'0'

bool isDigit(string a){
   for(int i = 0;a[i] != '\0';i++){
      if((int)a[i] > MAXNUMCHAR || (int)a[i] < MINNUMCHAR){
         return false;
      }
   }
   return true;
}

bool toBig(string a){
   if(a[4] != '\0'){
      return true;
   }
   return false;
}

int main(){
   string input;
   cin >> input;
   if(!isDigit(input) || toBig(input)){
      cout << "improper input\n";
   }
   else{
      //whatever yer fine XD
   }
}

void enter_numbers(string a, string b)
{
	
	int m = stoi(a);
	int n = stoi(b);
	int max = 0;

	
        /* don’t need this bc of my isDigit();
	if (a.size() >= b.size())
	{
		max = a.size();
	}
	else
	{
		max = b.size();
	}
        */
	//for (int i = 0; i < max; ++i) don’t need this bc of my isDigit();
	//{     don’t need this be of isDigit();
		if (!isDigit(a) || !isDigit(b))
		{
                        cout << "invalid input, please enter digits only!" << endl;
			return;
		}
	//} don’t need this be of isDigit();

        /* don’t need this be of my toBig();
	for (int j = 1; j <= 1; j++)
	{
		if (a.size() > 4 && b.size() <=4)
		{
			printf("%d too large (max 4 digits)\n", m);
			break;
		}
		else if (b.size() > 4 && a.size()<=4)
		{
			printf("%d too large (max 4 digits)\n", n);
			break;
		}
		else if (a.size() & b.size() > 4)
		{
			printf("%d and %d are too large (max 4 digits)\n", m, n);
		}
                */
		// else   We change this to if(!toBig()) and it checks by itself. Try not to mix printf() and cout BTW, apparently it’s bad habit or something 
                 if(! toBig())
		{
			cout << "the sum is "<< m+n << endl;
		} 
                else 
                {
                        cout << "too big!" << endl; // obviously change this to a better clause for is it’s too big or small ;)
                }
	//} Don’t need this bc of my toBig();
}

int main()
{
	char answer;
	do
	{
		string y, z;


		cout << "enter the first number" << endl;
		cin >> y;
		cout << "enter the second number" << endl;
		cin >> z;

		enter_numbers(y, z);
		
		cout << "try again(Y/N)?" << endl;
		cin >> answer;
} while (answer == 'Y' || answer == 'y');
		
	return 0;
}

EDIT: sry forgot to put my functions at the top.
Last edited on
Hello mcgrim8,

Sorry for the delat. I had to restart my computer and still playing catch up with what I was working on.

5- Dear Handy andy, you said above that you disagree with writing "using namespace std".
Can you please tell me why? As far as I can see, you don't use this line but you write std before all lines instead. Isn't it too much unnecessary work or is there anything important that I am missing.


the line using namespace std:: is a cheep way to put off teaching what should be done early. I have come to the understanding that books and schools do not teach what a name space is until later and teach the using line to avoid this. This is not really doing you any good and they are hoping you will learn about name spaces before it becomes a problem. This does not always work.

If you get use to using using namespace std:: some day it WILL cause you a problem. Then you will hours trying to figure out the problem only to end up here asking what is wrong.

Another problem is by not knowing what is in the standard name space yo will write variable names or function names that are the same as in the standard name space and the compile will produce errors because it does not know which variable of function to use and when the compiler tries to put "std::" infrount of your function and the parameters do not match the one in the standard name space the compiler will produce an error.

That is a quick exploitation, but you can do a search here on "using namespace std" for more information. There have been many posts dealing with this subject. I also found this link to be helpful even if it is ahead of what you know for now its worth reading. http://www.lonecpluspluscoder.com/2012/09/22/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/

You can also take a look at this page for now http://www.cplusplus.com /doc/tutorial/namespaces/ The whole page is worth reading.

For now what you are most likely to use is std::cin, std::cout, std::endl and std::string. These will increase as yo add newer header files to a program. Along with learning what is in the standard name space slowly you will also be learning VS's error messages and how to fix them slowly. Learning slowly and with repetition you will learn better than having to learn this all at once later.

As for your program.

First go back and take a look at the code in http://www.cplusplus.com/forum/beginner/257188/#msg1123671 I worked this up based on what you started with. Sorry if some of the things I did to speed up testing are confusing to you.

In time you will get tired of having to enter information through a "cin" statement just to test the program and fine that defining a variable, used in a "cin" statement, with an initial value and then commenting out the "cin" statement you can skip having to enter the same information every time the program and focus more on what is not working.

Looking at your latest code. What happened?? You had a good start and then came up with something that does not work.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void enter_numbers(string a, string b)
{

	int m = stoi(a);
	int n = stoi(b);
	int max = 0;



	if (a.size() >= b.size())
	{
		max = a.size();
	}
	else
	{
		max = b.size();
	}

First you need to rename the function. "check_string". This describes what the function does. "enter_numbers" is misleading as you enter nothing in the function.

On lines (4) and (5) you are using "stoi" to early. If the first string is "1234" everything is fine, but if it is "123a" "stoi" will convert (123) into an "int" stopping at the first character that is not a number. And if you have "12a4" it will convert (12) into an "int" stopping at the first character that is not a number. And the last example "a123" will cause a run time error because "stoi" can not convert the letter into a number. This is the same for both lines.

Line 6. What is this for? It has no purpose and does you no good.

The if/else does not make any sense.

In the next part:
1
2
3
4
5
6
7
8
	for (int i = 0; i < max; ++i)
	{
		if (!isdigit(a[i] || b[i]))
		{
			cout << "invalid input, please enter digits only!" << endl;
			break;
		}
	}

If a has a size of (2) and b has a size of (3) your for loop has a problem.

When "i" has a value of (1) everything is fine, but when "i" has a value of (2) this will put you past the end of the first number into memory that you have no idea of what is there.

Next is the if statement. I have no idea where you may have seen this or why you even think it works because it does not. It would be nice if it did, but that is not the way it is designed. The function "isdigit" works on only character at a time. What may hept here is if (!isdigit(a[i]) || !isdigit(b[i])) and with two (!) nots using "&&" may be need in place of the "||". Because the function is so wrong I have not tested this part much.

Next:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
	for (int j = 1; j <= 1; j++)
	{
		if (a.size() > 4 && b.size() <= 4)
		{
			printf("%d too large (max 4 digits)\n", m);
			break;
		}
		else if (b.size() > 4 && a.size() <= 4)
		{
			printf("%d too large (max 4 digits)\n", n);
			break;
		}
		else if (a.size() & b.size() > 4)
		{
			printf("%d and %d are too large (max 4 digits)\n", m, n);
		}
		else
		{
			cout << "the sum is " << m + n << endl;
		}
	}

The for loop goes from (1) to (1) what is the point as the code in the for loop executes only once. The for loop is not needed.

What possessed you to think that a "printf" is better than "cout"? First it is not a good practice to mix C code in a C++ program. Sometimes it is unavoidable and it does work, but here the "printf" statements do not do the output any better than a "cout" statement.

For the function to work properly it should look like:
1
2
3
4
5
6
7
8
9
10
bool check_string(std::string str)
{
	Check that the string has a length of 4.
            If not there is no reason to proceed. Return false

	In a for loop Check that the four characters are digits.
            If not return false

	If everything meats the requirements return true else return false.
}

My attempt at pseudo code such as it is. The idea is to show you the order that this should be done in. Refer to the code in http://www.cplusplus.com/forum/beginner/257188/#msg1123671 for a better idea.

Also you should be checking one string at a time.

The "main" function:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int main()
{
	char answer;
	do
	{
		string y, z;


		cout << "enter the first number" << endl;
		cin >> y;
		cout << "enter the second number" << endl;
		cin >> z;

		enter_numbers(y, z);
		
		cout << "try again(Y/N)?" << endl;
		cin >> answer;
        } while (answer == 'Y' || answer == 'y');
		
	return 0;
}

I meant to mention this earlier and got ahead of my-self. Avoid using a single letter for a variable name. It is hard to keep track of when reading through the code. This will become more noticeable when your code gets larger.

A variable should be a noun that describes what it is or does.

For lines 9 and 10 and then 11 and 12 you can put these in a do/while loop (two loops) with the while condition being (!CheckString(?)). This will stay in the loop until you enter a correct number.

Only when you have good strings to work with you use the "stoi" function then add your numbers together.

Hope that helps,

Andy
or the 2 cent answer, std is too big, so its better to do smaller using statements on what you need only, eg using std::cout. Or make yourself a small custom one that has cin/cout/common stuff that you use all the time but not the whole big std mess and use that instead.
Last edited on
Topic archived. No new replies allowed.