Quantcast
Channel: Forum Pasja Informatyki - Najnowsze pytania bez odpowiedzi
Viewing all articles
Browse latest Browse all 21942

conio.h na Linux

$
0
0
#include <iostream>
#include <cstdlib>
#include <unistd.h>
#include <ncurses.h>
#include <curses.h>
using namespace std;
float a,b;
char w;
int main()
{

    while(true)
    {
        cout << "Podaj pierwsza liczbe"<< endl;
        cin >> a;
        cout << "Podaj druga liczbe"<< endl;
        cin >> b;
        cout << "Menu:"<< endl;
        cout <<"--------------------"<<endl;
        cout << "1. Dodawanie."<<endl;
        cout << "2. Odejmowanie."<<endl;
        cout << "3. Dzielenie."<<endl;
        cout << "4. Mnozenie."<<endl;
        cout << "5. Podaj ponownie liczby."<<endl;
        cout << "6. Wyjscie z programu."<<endl;
        cout <<"--------------------"<<endl;
        cout <<endl;

        w = getch();


        switch (w)
            {
            case '1' :
               cout<< a+b;
            break;

            case '2' :
                cout << a-b;
            break;

            case '3' :

            if (b==0) {
                    cout<< "Nie dzielimy przez zero!!!";
                      }
            else
                    cout<< a/b;
            break;

            case '4' :
               cout << a*b;
            break;

            case '5' :
               system("exit");
            break;

            case '6' :
               exit(0);
            break;

            default :
                cout<< "Nie ma takiej opcji!!";


    }
    getchar();getchar();
    system("clear");
    }

    return 0;

Nie moge znalesc alteratywy dla conio.h pod linuxa probowalem curses.h  <ncurses.h>.

Wywala błędy:

undefined reference to `stdscr'

undefined reference to `wgetcg'

Znalazlem "rozwiazanie"http://stackoverflow.com/questions/1513417/why-is-curses-on-linux-giving-me-following-error   po skompilowaniu w terminalu  z opcja -lncurses program nie dziala poprawnie .


Viewing all articles
Browse latest Browse all 21942

Trending Articles


AutoMapa 6.27.0 ( 2301 ) Polska / Europe Finał ( PC_WinCE ) Cracked


Sprawdź z którą postacią z anime dzielisz urodziny


H. H. Schild - MRI Zrozumieć Rezonans Magnetyczny [PDF] [DJVU] [PL]


Alawar Keygen POLECAM


Kombajn ziemniaczany GRIMME HLS 750


POTANIACZ


Antena kierunkowa 2 el. Delta 7 pasm wg. SP3PL


1


Renault Laguna III - kontrolki (P) oraz /check handbrake


C4 Picasso 2011 - błąd U1218