Not seeing << ??

I used cout<< in other parts of my code but for some reason it's not seeing it at the one spot and it's the only error I'm getting... Why?

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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include <iostream>
#include <Windows.h>
#include <string>
using std:: cout;
using std:: cin;
using std:: endl;
using std:: string;
using namespace std;

enum ResistorSpecs {R_nominalValue,R_tolerance,R_minimumValue,R_maximumValue};


class Resistor
{

private:

static int ResCounter;
double ResistorSpecs [4];
	

public:
	Resistor();
~Resistor();
	bool SetResistance(double *ResistorPointer);
	double getResistance();
	void DisplayResistor();
	double getR_tolerance();
	double getR_minimumValue();
	double getR_maximumValue();
	double*ResistorPointer;
};


/////////////////////////////////////////////////////////

Resistor:: Resistor (void)
{

ResistorSpecs [R_nominalValue]=1000;
ResistorSpecs [R_tolerance]= 10;
ResistorSpecs[R_minimumValue] = R_nominalValue*(1-R_tolerance);
ResistorSpecs [R_maximumValue]= R_nominalValue*(1+R_tolerance);

ResCounter++;
}
int Resistor::ResCounter=0;
Resistor::~Resistor (void)
{
	delete[]ResistorPointer;
	ResCounter--;
}

bool Resistor:: SetResistance(double *ResistorPointer)
{
	if (*ResistorPointer<1000||*ResistorPointer>10000)
	{
		cout<< "Invalid imput, please try again";
		return false;
	}
	else
	{
*ResistorPointer = R_nominalValue;
ResCounter++;
		return true;
		
	}
}


double Resistor::getResistance() 
{ 
	return R_nominalValue; 
} 
double Resistor:: getR_tolerance ()
{
	return R_tolerance;
}
double Resistor :: getR_minimumValue()
{

	return R_minimumValue;
}
double Resistor :: getR_maximumValue()
{
	return R_maximumValue;
}
void Resistor::DisplayResistor ()
{
cout<< "Resistor's nominal value is:       " << getResistance();
cout<< endl;
cout << "Resistor's tolerance is:     "<< getR_tolerance();
cout<< endl;
cout<< "Resistor's minimum value is:      "<< getR_minimumValue();
cout<< endl;
cout << "Resistor's maximum value is:      "<< getR_maximumValue();
cout<< endl;
}


///////////////////////////////////////////////

int main (void)

{

	Resistor resistor;/// call class
	enum ResistorSpecs {R_nominalValue,R_tolerance,R_minimumValue,R_maximumValue};///// declare variables
	double ResistorSpecs; // declare variables
	double *ResistorPointer=NULL; //// pointer initialized with null
	ResistorPointer = new double[4]; /// request memory for variable
	static int ResCounter; /// static data member
   *ResistorPointer= rand()%10000+1000; // pointer random number generator
  
			
			/////////////////////////////////


   cout<< "This is your starting Resistor Values:      " << resistor.DisplayResistor(); //// This is where error is /////

			cout<< " Lets see what happens when we change the values";
			cout<<endl;
			cout<<"your new resistor value is:       "<< ResistorPointer;
			if (resistor.SetResistance(ResistorPointer))
			{
				cout << "Your new Resistance is:" << resistor.getResistance()<<"Ohms";
		cout<< endl;
			
			}
		

			//////////////////////////////////////////

			
	exit(0);
}
















Line 119 is your mistake

You are trying to cout a void function.

just do some text then call resistor.DisplayResistor()

or combine that cout with resistor.DisplayResistor()

here is an example that compiles below. some of the output looks funky though.

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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#include <iostream>
#include <Windows.h>
#include <string>
using std:: cout;
using std:: cin;
using std:: endl;
using std:: string;
using namespace std;

enum ResistorSpecs {R_nominalValue,R_tolerance,R_minimumValue,R_maximumValue};


class Resistor
{

private:

static int ResCounter;
double ResistorSpecs [4];


public:
	Resistor();
~Resistor();
	bool SetResistance(double *ResistorPointer);
	double getResistance();
	void DisplayResistor();
	double getR_tolerance();
	double getR_minimumValue();
	double getR_maximumValue();
	double*ResistorPointer;
};


/////////////////////////////////////////////////////////

Resistor:: Resistor (void)
{

ResistorSpecs [R_nominalValue]=1000;
ResistorSpecs [R_tolerance]= 10;
ResistorSpecs[R_minimumValue] = R_nominalValue*(1-R_tolerance);
ResistorSpecs [R_maximumValue]= R_nominalValue*(1+R_tolerance);

ResCounter++;
}
int Resistor::ResCounter=0;
Resistor::~Resistor (void)
{
	delete[]ResistorPointer;
	ResCounter--;
}

bool Resistor:: SetResistance(double *ResistorPointer)
{
	if (*ResistorPointer<1000||*ResistorPointer>10000)
	{
		cout<< "Invalid imput, please try again";
		return false;
	}
	else
	{
*ResistorPointer = R_nominalValue;
ResCounter++;
		return true;

	}
}


double Resistor::getResistance()
{
	return R_nominalValue;
}
double Resistor:: getR_tolerance ()
{
	return R_tolerance;
}
double Resistor :: getR_minimumValue()
{

	return R_minimumValue;
}
double Resistor :: getR_maximumValue()
{
	return R_maximumValue;
}
void Resistor::DisplayResistor ()
{
cout<< "Resistor's nominal value is:       " << getResistance();
cout<< endl;
cout << "Resistor's tolerance is:     "<< getR_tolerance();
cout<< endl;
cout<< "Resistor's minimum value is:      "<< getR_minimumValue();
cout<< endl;
cout << "Resistor's maximum value is:      "<< getR_maximumValue();
cout<< endl;
}


///////////////////////////////////////////////

int main (void)

{

	Resistor resistor;/// call class
	enum ResistorSpecs {R_nominalValue,R_tolerance,R_minimumValue,R_maximumValue};///// declare variables
	double ResistorSpecs; // declare variables
	double *ResistorPointer=NULL; //// pointer initialized with null
	ResistorPointer = new double[4]; /// request memory for variable
	static int ResCounter; /// static data member
   *ResistorPointer= rand()%10000+1000; // pointer random number generator


			/////////////////////////////////


            cout<< "These are your starting Resistor Values:      " << endl;
            resistor.DisplayResistor(); //// This is where error is /////

			cout<< " Lets see what happens when we change the values";
			cout<<endl;
			cout<<"your new resistor value is:       "<< ResistorPointer;
			if (resistor.SetResistance(ResistorPointer))
			{
				cout << "Your new Resistance is:" << resistor.getResistance()<<"Ohms";
		cout<< endl;

			}


			//////////////////////////////////////////


	exit(0);
}
Ohhhhh, Duh, Thank you so very much..... When you look at it for so long you start to miss the little things when your not used to doing this. Thank you again!
Topic archived. No new replies allowed.