Author Topic: /home/namai/programavimas/skyrius6.3/main.cpp||In function ‘int main()’:| /home/  (Read 2837 times)

richardsterrace

  • Guest
hi dudes,

i am newbie in c++ and i have just move from vista to ubuntu and i am getting some small troubles to know code block soft. For exaple :

||=== skyrius6.1, Debug ===|
/home/namai/programavimas/skyrius6.1/main.cpp||In function ‘int main()’:|
/home/namai/programavimas/skyrius6.1/main.cpp|14|warning: statement has no effect|
/home/namai/programavimas/skyrius6.1/main.cpp|16|warning: statement has no effect|
||=== Build finished: 0 errors, 2 warnings ===|


what does this mean has no effect,i have never had problem like this. alose there is an other more serious problem:
#include <iostream>
void failas();
void nustatymai();
void isspausdinti();
void iseiti();
void rodyti_meniu();
using namespace std;

int main()

{
    char ch;
    rodyti_meniu();
    while (cin.get(ch)!='x')

 ///// /home/namai/programavimas/skyrius6.3/main.cpp||In function ‘int main()’:|
/home/namai/programavimas/skyrius6.3/main.cpp|14|error: no match for ‘operator!=’ in ‘std::cin.std::basic_istream<_CharT, _Traits>::get [with _CharT = char, _Traits = std::char_traits<char>](((char&)(& ch))) != 'x'’|
||=== Build finished: 1 errors, 0 warnings ===|

 please help me

Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
It's not Code::Blocks related, it's a pure C++ programming question. You shouldn't post here.

But try looking here : http://www.cplusplus.com/reference/iostream/istream/
You can't use '!=' with 'cin' (this is a stream of the istream class).

That is what means "no match for ‘operator!=’ in ‘std::cin"

Look at operator>> instead.
Kernel Extremist - PedroM power ©