cout

  1. Sainatarajan

    C++ Program stops suddenly

    Question : I have to write a program to write object of class item to binary file then perform read,append,search and modify functions on the records. I have the written the following code. #include <iostream> #include <fstream> #include <cstdio> #include <cstring> #include <cstdlib> using...
  2. P

    problem in out put while using pointer in C++

    #include<iostream> using namespace std; class test { public: int* i ; test(int k) { i=&k; } }; int main() { test p(2); cout<<"for 1st time *(p.i) :"<< *(p.i); cout<<"\n"; cout<<"for 2nd time *(p.i) :"<< *(p.i); cout<<"\n"; cout<<"for...
  3. veddotcom

    [C++] Need help with Pointers

    CODE 1 void main() { int arr[]={11,12,13,14,15}; cout<<&&*arr; //this line gives Expression Syntax Error, WHY??????? } CODE 2 void main() { int arr[]={11,12,13,14,15}; cout<<&(&*arr); //this line gives Lvalue Required Error, WHY??????? } What i m thinking....may...
  4. MetalheadGautham

    C & C++ getch() and clrscr() functions in Linux

    Hope this helps newbies. clrscr() system("clear"); //Needs cstdlib headder file so do #include<cstdlib> getch() getchar(); // Needs stdio.h so do #include<stdio.h> And yeah, always use using namespace std; after including headders. Need that because actual usage of cout...
  5. C

    pls help c++construct timetable

    could anybody pls help mi!!!i do nt knw y my program go infinite loops.could anybody cn pls solve my problem.it is veri urgent!!!!!!no matter hw i change,i still cnnot gt the output tat i wan.cn anybody pls help 2 change my code.i will be delightful if anybody cn solve my problem!!!!! example...
  6. zegulas

    Whats wrong with this C++ code?

    I attended my 1st C++ lecture yesterday and learnt this program, after trying to compile & run it in Dev C++, it just runs n goes away in fraction of a second, I don't even know if it shows correct answer or not!
  7. S

    help!

    I am trying to self learn c++ and the first program mentioned in my book is #include <iostream> using namespace std; int main() { cout << "c++ is better than c.\n "; return 0; } In which of the digit's cd/dvd, the program which can execute this code is given?
  8. nikhil ramteke

    simple c++ program

    watch the following code:- #include<conio.h> #include<iostream.h> int main() { int c=0,a=0,b=0; clrscr(); cout<<"c="<<c++<<"\n"; cout<<"c="<<c<<"\n"; b=a++ +c++ +c++; cout<<"a="<<a<<"\n"; cout<<"b="<<b <<"\n"; cout<<"c="<<c; getch(); return 0; } o/p:- c=0 c=1 a=1 b=2 c=3 plz tell...
  9. S

    C++:Adding two numbers

    We have just started C++ in college #include <iostream> using namespace std; main() { int a,b,c; cout<<"Enter two nos.:"; cin>> a >> b; c=a+b; cin.get(); cout<<"Sum is"<<c<<""; cin.get(); } but on compiling and running it{no errors here}nothing happens when i...
  10. Official Techie

    problems in programming language

    i want to know whats the problem i want to print the address of a initialised variable #include<iostream.h> int main() { int i; int z; z = &i; cout<<"the address"<<z; cout<<"\n"; cout<<"the value is"<<i; return i; } the error --------------------Configuration: a...
  11. Maverick340

    Switch(not_working)

    #include<iostream.h> void main() { int d; char a; cout<<"Please enter your Date of Birth In the following Format :"; cout<<"DD\n" ; cin>>d; switch(d) { case (1): a="One"; break; case (2) :a="Two"; break; case (3) :a="Three"; break; default:a="Null 0000"; } cout<<a; }...
  12. D

    Temporary C++ amnesia 8|

    Simple one. But the result I expected was 1 while the actual thing is 2. So what exactly am I forgetting here? :shock:
Top Bottom