compile error

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
opportunity
New poster
Posts: 9
Joined: Thu Sep 15, 2005 11:35 pm
Location: dhaka

compile error

Post by opportunity » Fri Feb 24, 2006 10:15 pm

i've got compile error. but i cannot detect what the error is can anybody help me with this? thanx in advance.

// codes removed
Last edited by opportunity on Sun Feb 26, 2006 10:46 pm, edited 1 time in total.

User avatar
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba » Sat Feb 25, 2006 12:19 am

You should include <cstdio> if you're using scanf and fgets. Anyway, it's bad style to mix those with iostreams. You should also use code tag instead of pasting code directly.
For millions of years, mankind lived just like the animals. Then something happened which unleashed the power of our imagination. We learned to talk and we learned to listen...

opportunity
New poster
Posts: 9
Joined: Thu Sep 15, 2005 11:35 pm
Location: dhaka

thanks

Post by opportunity » Sun Feb 26, 2006 10:45 pm

hi,
thank u once again. this was really a silly mistake. i also tried not to use fgets but i could not input string with whitespaces. how can i do that if i want to use cin>> to read string from keyboard?

User avatar
Krzysztof Duleba
Guru
Posts: 584
Joined: Thu Jun 19, 2003 3:48 am
Location: Sanok, Poland
Contact:

Post by Krzysztof Duleba » Sun Feb 26, 2006 11:04 pm

You can use getline(cin, aString). Unfortunately, cin/cout are really slow in older versions of g++ and you can exceed time limit on many problems just by using them.
For millions of years, mankind lived just like the animals. Then something happened which unleashed the power of our imagination. We learned to talk and we learned to listen...

User avatar
tmdrbs6584
Learning poster
Posts: 98
Joined: Sat Jan 21, 2006 12:45 pm
Location: Busan,Corea(Republic of)

1

Post by tmdrbs6584 » Tue Feb 28, 2006 10:41 am

:roll: :wink: :P :oops: :cry: :evil: :o :-? 8) :lol: :x :) :( Hi logic
Bye logic :D

User avatar
tmdrbs6584
Learning poster
Posts: 98
Joined: Sat Jan 21, 2006 12:45 pm
Location: Busan,Corea(Republic of)

3124112345223564575376467453gsdfhjykliyncvbsfdgwreyw

Post by tmdrbs6584 » Tue Feb 28, 2006 10:41 am

Hi logic
Bye logic

sds1100
Learning poster
Posts: 95
Joined: Sat Dec 10, 2005 2:09 pm

kind Krzysztof Duleba

Post by sds1100 » Fri Mar 03, 2006 8:27 am

kind Krzysztof Duleba

Post Reply

Return to “C++”