On Wed, Aug 12, 2009 at 7:42 PM, Gaurang Aggarwal <honeygaur...@gmail.com>wrote:
> Hi , > > > I need help . I am using g++ in ubuntu 9.04 . > > This is C++ code . > > #include <stdio.h> use #include <stdio> > > #include <conio.h> Linux do not have conio.h by default -- this is a dos based library -- avoid using it,, use ncursor You forget a namespace declaration use namespace std ; > > void main() > { > int a,b,c; > cout << "enter the no."; > cin >> a >> b; > c= a+b; > cout<<"sum"<<c; > getch(); Do not use this getch(); just run a program from terminal and then run it ./a.out ,, you will see the output without using getch(); > > } > > qwerz...@ubuntu:~$ g++ ./cpp1.cpp > ./cpp1.cpp:2:19: error: conio.h: No such file or directory > ./cpp1.cpp:3: error: ‘::main’ must return ‘int’ > ./cpp1.cpp: In function ‘int main()’: > ./cpp1.cpp:6: error: ‘cout’ was not declared in this scope > ./cpp1.cpp:7: error: ‘cin’ was not declared in this scope > ./cpp1.cpp:10: error: ‘getch’ was not declared in this scope > > > " Above is the error > > > Please help .. > > Thanks > > _______________________________________________ ilugd mailinglist -- ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi http://www.mail-archive.com/ilugd@lists.linux-delhi.org/