Where I did wrong ?

Hey, I did this soft in last 10 min but I can't figure out what my mistake is ... please help me.

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

using namespace std;

unsigned int varstaTa, vfRo, anulNasterii, lunaNasterii, ziuaNasterii, anCurent, lunaCurenta, ziuaCurenta, var18, ziua_Ta, luna_Ta, anul_Tau;
string numeleTau;
char cetatenieRomana;


void datePersonale()
{
	cout << "\nIntroduceti in continuare numele dvs.: ";
	cin >> numeleTau;
	cout << "\nIntroduceti in continuare anul nasterii dvs.: ";
	cin >> anulNasterii;
	cout << "\nIntroduceti in continuare luna nasterii dvs.: ";
	cin >> lunaNasterii;
	cout << "\nIntroduceti in continuare ziua nasterii dvs.: ";
	cin >> ziuaNasterii;
	
	if (anulNasterii < 1900)
		cout << "\nVa rog sa fiti serios.";
	if (lunaNasterii > 12 || lunaNasterii == 0)
		cout << "\nVa rog sa fiti serios.";
	if (ziuaNasterii > 31 || ziuaNasterii == 0)
		cout << "\nVa rog sa fiti serios.";
	
	cout << "\nSunteti cetatean roman ?  (d/n) sau (D/N)  \n*d=da \n*n=nu ";
	cin >> cetatenieRomana;
	
	if (cetatenieRomana == 'N' || cetatenieRomana == 'n')
		cout << "\nIn acest caz nu puteti participa la acest program. \a";
	else
	{
		if (cetatenieRomana == 'd' || cetatenieRomana == 'D')
			vfRo = 1;
		else
		{
			vfRo = 0;
			cout << "\nVa rog sa restartati programul si introduceti 'da' sau 'nu'. \a";
		}
	}
	
	anCurent = 2011;
	lunaCurenta =  4;
	ziuaCurenta =  30;	
}
void verificareaVarstei()
{
	if (lunaNasterii >= lunaCurenta)
		luna_Ta = lunaNasterii - lunaCurenta;
	else
	{
		if (lunaNasterii < lunaCurenta)
			luna_Ta = 12 - (lunaCurenta - lunaNasterii);
	}
	anul_Tau = anCurent - anulNasterii;
	cout << "\nAi " << anul_Tau << " an(i) si " << luna_Ta << " luni(a)";
	
	if (vfRo == 1)
		cout << "\nAveti cetatenie romana.";
	else
		cout << "\nNu aveti cetatenie romana. \a";
}
void afiseaza_ma()
{
	cout << "Date Personale: \n" << datePersonale();
	cout << "\n\n Verificarea Datelor si Cetateniei: \n" << verificareaVarstei();
}
int main(void)
{
	cout << afiseaza_ma();
	cout << "\n\n" << numeleTau << ", ai " << anul_Tau << " an(i) si " << luna_Ta << " luni(a), si ai cetatenie romana.";
	
	return 0;
}


Please ( use google translate - romanian if needed please )
i get 1000000 errors like this few once:

1
2
3
4
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\ostream.tcc:63: note: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\ostream.tcc:74: note:                 std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits<char>]
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\ostream.tcc:86: note:                 std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits<char>]
C:\MinGWStudio\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\include\c++\3.4.2\bits\ostream.tcc:121: note:                 std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits<char>]
verificareaVarstei returns void. That is, it returns nothing at all. But on line 69, you try to feed that non-existent output to cout.

datePersonale returns void. That is, it returns nothing at all. But on line 68, you try to feed that non-existent output to cout.

afiseaza_ma returns void. That is, it returns nothing at all. But on line 73, you try to feed that non-existent output to cout.
Last edited on
so i can fix it by typing:

int verificareaVarstei()
int datePersonale()
int afiseaza_ma()
?
I am unfamilar with your language so i can tell what those functions are doing. But try:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void afiseaza_ma()
{
	cout << "Date Personale: \n";
    datePersonale();
	cout << "\n\n Verificarea Datelor si Cetateniei: \n";
    verificareaVarstei();
}
int main(void)
{
	afiseaza_ma();
	cout << "\n\n" << numeleTau << ", ai " << anul_Tau << " an(i) si " << luna_Ta << " luni(a), si ai cetatenie romana.";
	
	return 0;
}
THANKS !

IT DOES WORK !
Topic archived. No new replies allowed.