cawte zacinam sa ucit programovat podla knizky "C++ bez predchozich znalosti" a ked som sa dostal na 4 kapitolu kde som mal spravit vypocet priemerneho skolneho na studenta
Kód:
#include <iostream>
using namespace std;
int main(void)
{
int registrovano, pridano, zruseno;
cout << "Zadajte pocet predregistrovanych studentov: ";
cin >> registrovano;
cout << "zadajte pocet studentov ktory si prednasku zapisali dodatocne: ";
cin >> pridano;
registrovano += pridano;
cout << "Zadajte pocet studentov ktory si prednasku zrusili: ";
cin >> zruseno;
registrovano -= zruseno;
cout << "Celkovy pocet studentov: " << registrovano << "\n";
skolne = (registrovano + zruseno) * 72;
cout << "Skolne celkom: " << skolne << " dolaru\n";
cout << "priemerne skolne na zapisaneho studenta: "
<< (float) skolne/registrovano << " dolaru\n";
return 0;
}
Je to podla knizky (samozrejme) ale ked som dal "build solution" a vyhodilo mi to chyby:
------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
Compiling...
sizeof.cpp
c:\documents and settings\filip\my documents\visual studio 2008\projects\helloworld\helloworld\sizeof.cpp(15) : error C2065: 'skolne' : undeclared identifier
c:\documents and settings\filip\my documents\visual studio 2008\projects\helloworld\helloworld\sizeof.cpp(16) : error C2065: 'skolne' : undeclared identifier
c:\documents and settings\filip\my documents\visual studio 2008\projects\helloworld\helloworld\sizeof.cpp(18) : error C2065: 'skolne' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\filip\My Documents\Visual Studio 2008\Projects\HelloWorld\HelloWorld\Debug\BuildLog.htm"
HelloWorld - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
pls uz som skusal co ma napadlo ale neuspesne.
DIK ZA ODPOVED!!!