- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
15 Posted Topics
Re: Call by reference method is good here. Try it. | |
Re: make the connection statement at the end of the function and try once more. It is better to use constructor than 'init()'. | |
Re: /* Program to print the Pascal's triangle recursively */ [CODE]#include<stdio.h> int pascal(int,int); void space(int,int); main() { int num,i,j; printf("\nEnter the no. of rows required: "); scanf("%d",&num); for(i=1;i<=num;i++) { space(num-i,3); for(j=1;j<=i;j++) { printf("%3d",pascal(i,j)); space(1,3); } printf("\n"); } } int pascal(int row,int column) { if(column==0) return 0; else if(row==1&&column==1) return 1; else … | |
Re: Edit your code as: [CODE]case 2: cout<<"Enter the Customers National Number ID"<<endl; cin>>ni; for (int i=0; i<150;i++) { if (ni==CustArray[i].customer_id) { CustArray[i].showCustomers(ni); } } break;[/CODE] [CODE]// Here loop is removed void Customers::showCustomers(int ni) { if (ni==customer_id) { cout <<"Customer Information"<<endl; cout <<"*********************"<<endl; cout<<"Customer ID:"<< customer_id <<endl; cout<<"ID:"<< id <<endl; cout<<"Name:"<< … | |
Re: How do you want to solve pascal triangle? Directly or recursively? Post your current developments. | |
Re: In your struct Node, [CODE]struct Node { Data data; Node* left; Node* right; };[/CODE] What do the variables left and right mean? Can you explain the logic that you want to implement? Thanks | |
Re: I can help you. But post the program you have written. | |
Re: 1.what does return 2,return 4,return 6 means in this code? Ans: The function prcd(char) returns these values. These are the values used to indicate a precedence of various operators used. ie, here the precedence order is +,- has precedence 2; *,/ has precedence 4 and is greater than that of … | |
Re: Try this: [CODE]int main() { CandyBar *detailOfCandy; detailsOfCandy=new CandyBar[3]; strcpy((detailOfCandy+0)->candyName,"Donkey"); // include header file string.h (detailOfCandy+0)->candyAmount=2.5; (detailOfCandy+0)->twoCandyWeight=200; strcpy((detailOfCandy+0)->candyName,"Monkey"); (detailOfCandy+0)->candyAmount=4.4; (detailOfCandy+0)->twoCandyWeight=100; strcpy((detailOfCandy+0)->candyName,"Honkey"); (detailOfCandy+0)->candyAmount=3.3; (detailOfCandy+0)->twoCandyWeight=50; // use rest of code ........... ........... } [/CODE] | |
Re: [CODE]while(node!=NULL){cout<<endl<<i<<" "<<node->d;i++;node=node->next;} [/CODE] [B]Explanation:[/B] This block prints all the elements from start to end. condition: node=NULL, means the end of the list. i is just used as an index. node->next has the address of the next item in the list: node=node->next : node is a pointer of type list, value … | |
Re: Gtk is the framework used along with C/C++ programs. Gtk has several predefined components which make GUI programming very easy. for more details: [url]http://www.gtk.org/documentation.html[/url] | |
Re: Here an example is given: #define VALUE(value1,value2) strcpy(val1,value1);\ strcpy(val2,value2);\ cout<<val1<<endl<<val2<<endl; main() { char val1[30],val2[30]; // these variables are used to store the string passed VALUE("abc","def"); } You can follow this if sufficient. | |
Re: Do you want to use the object of 'Flights' inside the same class? if, yes Follow the following outline: Class Flights { public: Flights *FL; ....... ....... void function() // use a non constructor function for this { FL=new Flights[150]; ........ } ........ }; | |
Re: You can access the music files just like text files. You can do simple task such as copying, cutting etc like this. To access music files properly, you need to follow the encoding technique of the file format. |
The End.