Unrecognized Error

I'm not sure I understand this error message for line 38 of my code.

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
  #include <iostream>
#include <iomanip>

using namespace std;

void initialize(double list[], int size);

void print(double list[], int size);

int main()
{
	double alpha[50];

	initialize (alpha, 50);

	print (alpha, 50);

	return 0;
}

void initialize(double list[], int size)
{
	int count = 0;

	for (count = 0; count < 25; count ++)
		list[count] = count * count;

	for (count = 25; count < size; count ++)
		list[count] = 3 * count;
}

void print(double list[], int size)
{
	int count;
	for(count = 0; count < size; count ++)
	{
		cout << setw(4) << list[count] << " ";
		if ((cout + 1) % 10 == 0)
			cout << endl;
	}
	count << endl;
}


Here is what the error message 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
1>  main.cpp
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::_String_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_iterator<_Elem,_Traits,_Alloc>' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xstring(434) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::_String_const_iterator<_Elem,_Traits,_Alloc> std::operator +(_String_const_iterator<_Elem,_Traits,_Alloc>::difference_type,std::_String_const_iterator<_Elem,_Traits,_Alloc>)' : could not deduce template argument for 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xstring(293) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::_Array_iterator<_Ty,_Size> std::operator +(_Array_iterator<_Ty,_Size>::difference_type,std::_Array_iterator<_Ty,_Size>)' : could not deduce template argument for 'std::_Array_iterator<_Ty,_Size>' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xutility(2068) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::_Array_const_iterator<_Ty,_Size> std::operator +(_Array_const_iterator<_Ty,_Size>::difference_type,std::_Array_const_iterator<_Ty,_Size>)' : could not deduce template argument for 'std::_Array_const_iterator<_Ty,_Size>' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xutility(1929) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::reverse_iterator<_RanIt> std::operator +(_Diff,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xutility(1323) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2784: 'std::_Revranit<_RanIt,_Base> std::operator +(_Diff,const std::_Revranit<_RanIt,_Base> &)' : could not deduce template argument for 'const std::_Revranit<_RanIt,_Base> &' from 'int'
1>          c:\program files\microsoft visual studio 10.0\vc\include\xutility(1136) : see declaration of 'std::operator +'
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(38): error C2676: binary '+' : 'std::ostream' does not define this operator or a conversion to a type acceptable to the predefined operator
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(41): error C2563: mismatch in formal parameter list
1>c:\documents and settings\skratz\my documents\testproject\main.cpp(41): error C2568: '<<' : unable to resolve function overload
1>          c:\program files\microsoft visual studio 10.0\vc\include\ostream(1021): could be 'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>          with
1>          [
1>              _Elem=unsigned short,
1>              _Traits=std::char_traits<unsigned short>
1>          ]
1>          c:\program files\microsoft visual studio 10.0\vc\include\ostream(1011): or       'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>          with
1>          [
1>              _Elem=wchar_t,
1>              _Traits=std::char_traits<wchar_t>
1>          ]
1>          c:\program files\microsoft visual studio 10.0\vc\include\ostream(1003): or       'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
1>          with
1>          [
1>              _Elem=char,
1>              _Traits=std::char_traits<char>
1>          ]
1>          c:\program files\microsoft visual studio 10.0\vc\include\ostream(977): or       'std::basic_ostream<_Elem,_Traits> &std::endl(std::basic_ostream<_Elem,_Traits> &)'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
On line 38, you wrote cout instead of count - in other words, you made a typo and forgot the n.
Topic archived. No new replies allowed.