- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
8 Posted Topics
Re: the recursive code (function call itself ) will be as follow #include <iostream> #include <cstdlib> int reverse_num (int n,int m) ; using namespace std; int main() { int n; int m=0; cout<<"enter number to reverse :"; cin>>n; cout<<reverse_num(n,0)<<endl; //calling the function system("pause") ; return 0; } int reverse_num(int n,int m) … | |
Re: about the second question yes you can use pointer to refrence to another pointer and this is the method used in dynamic allocation of multi dimintion aray you can write : void a2d(int i,int j) { int **t =new int* ;//rows for(int k=0;k<i;k++) t[k]=new int[j] ; //col } but i … | |
Re: antgross=totantstycken/144; antdussin=totantstycken/144; u again divide the same value on the same divisor u must replace the line :antdussin=totantstycken/144; with the following two lines : totantstycken%=144; //get the nuber of non gross piesec antdussin=totantstycken/12; //get the number of dussin | |
Re: type after the include line : using namespace std; that is because cout defined in this namesoace that is all | |
Re: if u create a console application : first in c++ use #include <iostream> not <iostream.h> it is two different files where the first is more enhanced than the other then u must add this statment after the includes : using namespace std ; compile....run....see hello...and have fun note :from vc++ … | |
Re: it is wrong to do such expression (assign the same variable (i) in a single operation more than onetime) it gives a machine dependent result | |
Re: to flush input buffer u can #include <conio.h> void main () { /* code */ getch() ; //take input from keyboard buffer before displaying in the screen /*rest of code*/ } is this the answer to your question ? | |
I have a code which is near to this one struct first { int data ; list <second> seconds ; }; struct second { int data ; list <first>::iterator vert ; }; how i could get rid of the circular reference problem in c++ note : i must put the … |
The End.