233 Posted Topics
Re: [code=c++] void DisplaySalsa(string salsa[], int numsold[]) { cout<<"Salsa Type Jars Sold " <<endl; for (int k=0; k<max; k++) { cout<<"salsa["<<k<<"] = "<<salsa[k]<<endl; cout<<"numsold["<<k<<"] = "<<numsold[k]<<endl; } } [/code] | |
Re: Like this.. [code] current_deg current_min current_sec if(current_sec >= 60) then begin current_min++ current_sec=(current_sec-60) end if(current_min>=60) then begin current_deg++ current_min=(current_min-60) end [/code] | |
| |
Re: [code=c++] #include<stdio.h> #include<conio.h> #include<math.h> int main(void) { int N, M, R, S; printf("\nPlease enter N\n"); scanf ("%d", &N); printf("\nPLease enter M\n"); scanf ("%d", &M); R=(N-(M*(N/M))); if(R > 0) { S=(M-(M*(M/R))); printf("S = %d\n",S); } printf("R = %d\n",R); int AB=(M*(M-(M*(M/R)))); printf("AB = %d\n",AB); system("pause"); return(0); } [/code] | |
Re: [code] double x=a-((2*(com/1000))+b); [/code] | |
Re: Try.. [code] strlen(article[0]); //or getSize(article[0]); //??? [/code] | |
Re: Means.. n=0, m=0 1. if Buffer[n] = 'null' then stop 2. if Buffer[n] = 'space' then n = n + 1, m = m + 1, back to step 1 3. m = m + 1 4. Buffer[n] = Buffer[m], back to step 1 | |
Re: The question is..Find them.. Got one, nah two, annnnd...another one!.. Here u go.. [code] 1. double num_one, ...; 2. char ans; 3. average = (...)/8; [/code] | |
Re: I dont see a problem too..As long as u returned the rite type.. | |
Re: Another corrections.. [code] //cin>>firstName; cin.getline(firstName,30); //cin>>lastName; cin.getline(lastName,30); //cin>>NID; cin.getline(NID,30); [/code] | |
Re: Compiler menu..Click Project->(prj name)properties..And then click Configuration Properties->C/C++->Precompiled Header.. Create/Use PH..Change it.. | |
Re: Check the size.. [CODE] int i=0; string aWord = "abcdf!"; while(aWord[i]) { if(isalpha(aWord[i])) printf ("character %c is alphabetic\n",aWord[i]); else { aWord.erase (i, 1); //..Is idx > length if(i>aWord.size()) break; i--; } i++; } cout<<aWord; [/CODE] | |
Re: Here's a sample code..The rest is yours.. [code] void swap(int items[], int i1, int i2) ( int t = 0; t=items[i1]; items[i1]=items[i2]; items[i2]=t; ) int main() { int n=0,m=0; const int s=4; int num[s]={4,1,2,3}; for(;n<s;n++) std::cout<<num[n]<<std::endl; for(n=s-1;n>0;n--) for(m=0;m<n;m++) if(num[m]>num[m+1]) swap(num,m,m+1); num[s-1]=0; std::cout<<std::endl; for(n=0;n<s;n++) std::cout<<num[n]<<std::endl; return 0; } [/code] | |
Re: Simply.. [code] //... char rep='n'; //display the menu and get user's choice while(tolower(rep)=='n') { //...Menu cout<<"repeat? [y/n] : "; cin>>rep; } return 0; //bye.. [/code] | |
Re: [QUOTE=ArkM;748688] Don't waste a time and traffic on this funny "problems"...[/QUOTE] :) .. :) | |
Re: Maybe IClassFact is a reference class only.. | |
Re: ???!..C++ is case-sensitive..Am i rite?.. | |
Re: [code] //... bool repeat=false; do{ //... switch(cho){ default: //...Bad input repeat=true;} }while(repeat); [/code] | |
Re: Is this what u need.. [code=c++] template<class T>class X { class Y { public: //...Declare it first Y *operator[](int); } //... } template<class T>typename X<T>::Y *X<T>::Y::operator[](int idx) { //blahblah } [/code] | |
| |
Re: Because you did not initialize it..Example.. [code=c++] // declare n init unsigned char a='a'; // display std::cout<<a; [/code] | |
Re: Here..this is a function.. [code=c++] int f_i(int x,int y) { //... return (x+y); } // you meant // z = f_i(...,...)!! [/code] | |
Re: You did not flush the std input buffer..Just think.. | |
Re: [code=c++] 1. void stack::reverse(node* ptr) // node ??? //-- void stack::reverse(NodeType* ptr) 2. class stack { private: NodeType* topPtr; public: stack(); void push(ItemType); // see this int pop(); bool isempty(); bool isfull(); void print(); void print_reverse(stack); void reverse(node) void push(ItemType); // and this }; 3. node,??? maybe NodeType 4. push(...), … | |
Re: [code] if (choice == 'y') // ... [/code] | |
Re: Missing ',' huh.... see this.. [code=c++] void Blackjack::InitDeck(Card deck[] int numCards) { //... } [/code] | |
Re: I'am sure there is an error..Not only failed to display the freakword count.. | |
Re: Semicolon is missing.. Example.. [code=c++] class Cmy { //... }; // here [/code] | |
Re: [code=c++] //... if (ch < 'a' && ch > 'z') //...Do you understand this? [/code] | |
Re: Maybe this can help.. [code=c++] // .. cin.getline(data[i].name,30); // ... [/code] | |
Re: I think the codes was OK, but not secure yet.. | |
Re: [QUOTE=elsa87;743516]what's wrong with x.push(item); and x.print_reverse(); ????[/QUOTE] 1. Item is ItemType, not int..Get int from ItemType first then Push.. 2. x.print_reverse(int) rite!. The arg must int.. | |
Re: Do not need [code]#include<QtGui.h>[/code] at Ghost.h | |
Re: You guyz talk to much..She just want the codes..So!!... | |
Re: Should be.. [code=c++] if(payrate < 10 && hours > 40) { // begin if //-- your code here } // end if else //...Else [/code] | |
Re: I assume that draw is not a reference class..So you must declare it first..Example [code=c++] draw p_draw = new draw; [/code] | |
Re: Wow that's cool, i'll take it, are u sure there is no error?.. Don't forget to use code tag.. | |
Re: You opened file that already open [code=c++] int main(){ //... rawdata.open("story.txt"); //... } binarySearchTree(node *r){ //... sorted.open("story.txt"); //... [/code] | |
| |
Re: 1. Always define you vars. 2. Array index always begin with 0. 3. I always can't write English better..Sorry | |
Re: What's a problem?..Detail please.. | |
Re: Simple example.. [code] Open a files, while ch = getc(files) { ary[i] = ch << 2; display ary[i] } [/code] | |
Re: Try to insert val at pos 4 without insert val at pos 2..Is it work?.. | |
Re: I don't test it yet :)..Try it.. [code] setfillstyle(SOLID_FILL,level); // or fillpoly(level,poly); [/code] | |
Re: 1. DYNAMIC : Nop...must be constant... 2. ICON : try to use Windows API, or embeded it to your resource OK, we love to see you code... Sorry for my bad English :) | |
Re: If you want to sharing your global variables, use 'static' on them.. Example: [code=c++] static int myArray[2][2]; [/code] |
The End.