Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

compile errors...

[es] :: C/C++ programiranje :: compile errors...

[ Pregleda: 2569 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

TechnoChronox
in a galaxy far, far away

Član broj: 69590
Poruke: 9
*.dlp107.bih.net.ba.

Sajt: www.w3.org


Profil

icon compile errors...01.10.2005. u 01:25 - pre 225 meseci
Code:
#include <iostream.h>

int main()
{
enum Days ( monday, tuesday, wendnesday, thursday, friday, saturday, sunday);
Days DayOff;
int x;
cin >> x;
cout << "Enter a value (0-6)";
DayOff = Days(x);
if (DayOff == saturday || DayOff == sunday)
    cout << "Weekend!\n";
    else
    cout << "Working day!\n";
}


Koristim dev-c++ compiler, i prilikom kompajliranja navedenog koda izbaciva mi uvijek " use of enum `Days' without previous declaration " + jos 12 povezanih gresaka sa ovom. Vjerovatno je neka ocita greska ali je sam jednostavno blind a i ovako mi je lupajuci u zid dosta... Pocetnik sam u c++ programiranju i ovaj sam example nasao u nekom tutorialu ali jednostavno kada nece, nece...
The truth is out there somewhere...
 
Odgovor na temu

mulaz
Ljubljana

Član broj: 47602
Poruke: 2239
*.dial-up.dsl.siol.net.

Jabber: mulaz@elitesecurity.org
Sajt: www.mulaz.org


+184 Profil

icon Re: compile errors...01.10.2005. u 01:36 - pre 225 meseci
Code:

bash-3.00$ c++ bla.cpp 
In file included from /usr/include/c++/3.3.6/backward/iostream.h:31,
                 from bla.cpp:1:
/usr/include/c++/3.3.6/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
bla.cpp: In function `int main()':
bla.cpp:5: error: use of enum `Days' without previous declaration
bla.cpp:5: error: `monday' undeclared (first use this function)
bla.cpp:5: error: (Each undeclared identifier is reported only once for each 
   function it appears in.)
bla.cpp:5: error: `tuesday' undeclared (first use this function)
bla.cpp:5: error: `wendnesday' undeclared (first use this function)
bla.cpp:5: error: `thursday' undeclared (first use this function)
bla.cpp:5: error: `friday' undeclared (first use this function)
bla.cpp:5: error: `saturday' undeclared (first use this function)
bla.cpp:6: error: `sunday' undeclared (first use this function)
bla.cpp:7: error: `Days' undeclared (first use this function)
bla.cpp:7: error: syntax error before `;' token
bla.cpp:11: error: `DayOff' undeclared (first use this function)
bash-3.00$ 


ne znam ni ja bas puno o c++... ali valjda si zaboravio da deklarises "Days"

seas se ono na pocetku c++:
Code:

int nesto;
nesto = 7; 

Bolje ispasti glup nego iz aviona
http://www.mulaz.org/
 
Odgovor na temu

Dragi Tata
Malo ispod Kanade

Član broj: 1958
Poruke: 3906
*.dyn.optonline.net.



+6 Profil

icon Re: compile errors...01.10.2005. u 02:02 - pre 225 meseci
Samo jedna od lepota C/C++ sintakse. Obrati pažnju na zagrade kod deklaracije enum-a.
 
Odgovor na temu

TechnoChronox
in a galaxy far, far away

Član broj: 69590
Poruke: 9
*.dlp486.bih.net.ba.

Sajt: www.w3.org


Profil

icon Re: compile errors...01.10.2005. u 12:10 - pre 225 meseci
Trebaju mi naocale... :-)
The truth is out there somewhere...
 
Odgovor na temu

[es] :: C/C++ programiranje :: compile errors...

[ Pregleda: 2569 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.