97 Posted Topics

Member Avatar for Phinisher

[QUOTE=Phinisher;1453521]Unfortunately, that didn't work either. I understand getline, but may I ask how it is more efficient in the case of words? Wouldn't I still have to parse through each character in search of whitespace to determine a word? Could you give me a quick example, because I don't feel …

Member Avatar for griswolf
0
110
Member Avatar for mike42intn
Member Avatar for garu525

There are some errors. The outer while loop ... [CODE]while (!infile.eof() { . . }[/CODE] will iterate through all the lines of your file. So the values of max, min and sum after the loop will be from the numbers of last line. You lost all the max, min and …

Member Avatar for garu525
0
313
Member Avatar for IS_student

The size member of class arrayListType is not getting any value and because of that list is not getting allocated.

Member Avatar for IS_student
0
115
Member Avatar for Anuradha Mandal

In show(), use a loop to traverse through the list till [CODE=C++]info->next!=NULL[/CODE] and increment info every time to point to the next node. In your code, you are not progressing through the list.

Member Avatar for vidit_X
0
90
Member Avatar for ekailan
Member Avatar for glenak

The problem with the code above is the class GradeBook is getting declared twice. Once in the header file and once in your code. So when you remove the header file "GradeBook.h", the code compiles properly. And about your query of programing with header files. Dividing programs into files makes …

Member Avatar for glenak
0
157
Member Avatar for shanker86

Seems like you would like to overload << operator for your generic class pair2. You have not declared the overloaded operator function in your class and then you are defining it outside the class. Either define it inside class or declare it inside class and then define it outside.

Member Avatar for shanker86
0
431
Member Avatar for jessikwa

The problem is function declarations, you have declared both functions to take 0 arguments - [CODE]void getJudgeData(); void calcScore();[/CODE] Correct them and it should work. And using system("pause") is not good.

Member Avatar for jessikwa
0
4K
Member Avatar for DonutsnCode

You cannot use a void returning function with cout. Since you are outputting something on screen using displayObject(), why not just call it separately. Something like ... [CODE]GradeBook myObject( "You got Owned, g++ won't compile" ); cout << "myObject initialized\n"; myObject.displayObject(); cout<<endl;[/CODE]

Member Avatar for DonutsnCode
0
139
Member Avatar for itpipx

You need to have a global main too. [CODE]::main();[/CODE] And please use code tags around your code, it helps those who wants to help you :)

Member Avatar for itpipx
-1
134
Member Avatar for iluwinter

The problem is function declaration. You have declared the functions to be accepting a char, instead of a char* though you have defined them properly. Correct the function declarations and it should work.

Member Avatar for vidit_X
0
146
Member Avatar for YingKang

In Student.h, function declaration of setStudent takes an integer array or integer pointer as argument. [CODE]void setStudent(string idIn, string fNameIn, string lNameIn,int scoreIn[]);[/CODE] But while calling it on line 39 in your code or line 40 here ... [CODE]student[numOfStu].setStudent(id, fName, lName, score[SCORE]);[/CODE] you are actually passing an integer in place …

Member Avatar for vidit_X
0
121
Member Avatar for burcin erek

This won't compile because function x is having two overloaded versions with same signature - [CODE]void x(char)[/CODE] It should produce an error "Function Re-Declared" .. something like that.

Member Avatar for burcin erek
0
117
Member Avatar for burcin erek

When the user enters the number wrong 10 times, xxx becomes equal to 0. And then this code [code=c++] if (xxx==0) goto son; [/code] causes it to exit. Modify the tekrar function, so that it resets xxx. It asks the user if he would like to play more but doesn't …

Member Avatar for burcin erek
0
288
Member Avatar for shahanakazi

Please use code tags. The line [code] cin>>next; [/code] takes input from the user for the number of eggs and then adds it to total. The while loop continues taking the number of eggs in each nest till the user enters any negative number.

Member Avatar for vidit_X
0
229
Member Avatar for fukki

[QUOTE=;][/QUOTE] As per my understanding of your problem, you need to declare car as a global variable and you'll be able to access it from everywhere without redeclaration. Also, you have not defined "option" variable used on line 16 and 18. On line 16, you are treating as a simple …

Member Avatar for NathanOliver
0
119
Member Avatar for tsotne1990
Member Avatar for burcin erek

[QUOTE=;][/QUOTE] Please correct the code tags. >> operator reads until the first whitespace character. So when you are reading the file which has "burcin eric 783389" with the following code [code=C++] f>>name1>>numb1; [/code] name1 gets burcin and numb1 gets erec.

Member Avatar for burcin erek
0
122
Member Avatar for timb89

Hint : You are adding elements to tree's root only. And what's the purpose of line 97. [code=C++] array[index]; [/code]

Member Avatar for timb89
0
175
Member Avatar for I_am_barrage
Member Avatar for rena0514

In reduce function, you are equating x and y to local uninitialized variables a and b which should give errors. Set function looks ok, but in get you are returning parameter values instead of actual numerator and denominator values. I have not checked the logic of your program.

Member Avatar for StuXYZ
0
193
Member Avatar for pradeey
Member Avatar for eduard77

First thing, don't use system("pause"). Why sum1==sum, the question says when the investment of Celio exceeds Daphne's. Also in loop, you are just incrementing sum1 and sum... do you think that's correct?

Member Avatar for eduard77
0
233
Member Avatar for vello

Declare find() before main() and it should work. [CODE]bool find(int&,int)[/CODE]

Member Avatar for arkoenig
0
201
Member Avatar for praky

I don't think it'll work because ifstream won't work with File pointer i.e ifstream parameter won't accept a File Pointer.

Member Avatar for brandonrunyon
0
428
Member Avatar for winnie89

cout<<"String"; The "String" should start and end on same line in the editor or you can extend it like .. cout<<"Str" <<"ing";

Member Avatar for mitrmkar
0
213
Member Avatar for DaCaj

I tried compiling the header "Globals.h" and the first cpp defining GlobalVars(). It didn't give any error.

Member Avatar for vidit_X
0
637
Member Avatar for ThrasherK

Is it that you want the menu to be displayed according to the Account ID? Can you please detail a little more about your problem.

Member Avatar for Duki
0
209
Member Avatar for delle

Don't use System("pause"), instead as LordNemrod suggested use cin.get().

Member Avatar for Duki
0
210
Member Avatar for NervousWreck
Member Avatar for Uma_fb
Member Avatar for prasadk123
0
1K
Member Avatar for Duki
Member Avatar for vidit_X
0
105
Member Avatar for jprogram

You can't get something from an output stream ... Do you want to read a single character at a time from a file, crypt it and then put it back on a new file?

Member Avatar for vidit_X
0
194
Member Avatar for vidit_X

Question by ~s.o.s~ Write a program which will perform the job of moving the file from one location to another. The source and destination path will be entered by the user. Perform the required error checking and handle the exceptions accordingly. (Intermediate) [code=c++]#include<fstream> #include<iostream> #include<cstdio> using namespace std; int main(){ …

Member Avatar for mrnutty
0
381
Member Avatar for kangarooblood

In for loop, you used condition "dword[a] > 0" ? What you meant by that? You using an old compiler? inlcuding <iostream.h> You should not use goto, it creates bad code instead use do while.

Member Avatar for jonsca
0
174
Member Avatar for RooiBaard

I didn't got you completely. Why to use Find and replace? For Encryption : Open the file, read the lines in a string, call encrypt and then store back. For Decryption : Open the file, read the lines in a string, call decrypt and then store back. Is that what …

Member Avatar for vidit_X
0
125
Member Avatar for sidra 100

[code]s=temp[/code] s a char array & temp a strng object. [code]return s[/code] What's the return type of operator +=? Is is char*?

Member Avatar for tkud
0
114
Member Avatar for vidit_X

Practise problem by ~s.o.s~ Q. Write a program which performs addition, subtraction, multiplication of matrices. The dimensions of both the matrices would be specified by the user (dynamic memory allocation required). Use of structure or a class to define the matrix would be a good idea. (Expert) [CODE]#include<iostream> using namespace …

Member Avatar for vidit_X
0
266
Member Avatar for enderes05
Member Avatar for shopnobhumi

For prime function, have a look at this thread - [url]http://www.daniweb.com/forums/thread143933.html[/url] . And for random function, have a look at this thread - [url]http://www.daniweb.com/forums/thread1769.html[/url]

Member Avatar for skatamatic
0
831
Member Avatar for muya08
Member Avatar for ohnomis

I think you can declare and intilialize steps after the function "processTurtleMoves" declaration. [code=c++] void TurtleGraphics::processTurtleMoves( const int commands[] ) { int steps=0; .... .. .. .... .. .. } [/code] This should solve the problem. And as WaltP said, use a prefix form rather than a postfix one.

Member Avatar for vidit_X
0
152
Member Avatar for CPPRULZ

Function call should be like this [CODE] func(array_name); //where array_name is the name of your array. [/CODE] You should pass the array without any index, because passing with an index makes the value at that index to be passed as argument not the array. And you second question's answer - …

Member Avatar for vidit_X
0
350
Member Avatar for vidit_X

[URL="http://www.daniweb.com/forums/post303743-1.html"]Q.Write a program which will print all the pairs of prime numbers whose sum equals the number entered by the user. ( suggested by Aniseed ) (Intermediate) [/URL] [code=C++] #include<iostream.h> #include<conio.h> #include<math.h> int prime(int); void main() { int i,j,c1,c2,num,f1,f2; clrscr(); cout<<"Enter the number-"; cin>>num; for(i=2,j=num-2;i<=num/2;i++,j--) { f1=prime(i); if(f1) { f2=prime(j); …

Member Avatar for vidit_X
0
656
Member Avatar for JonathanHXC

[QUOTE=BradenMurphy;685236]system("pause"); return 0; use that at the end of ur main method should work:)[/QUOTE] I think using system("pause"); is not recommended.

Member Avatar for vidit_X
0
120
Member Avatar for vidit_X

This is strstr() function made by me as given in the practice problem. [code=c++] char *cstrstr(char s[],char ss[]) { int l1,l2,i,j,k,flag=0; char *p=NULL; l1=strlen(s); l2=strlen(ss); for(i=0;i<l1;i++) { //cout<<"i:"<<i; p=&s[i]; if(ss[0]==s[i]) { for(k=i,j=0;j<l2;j++,k++) { //cout<<"j:"<<j<<"k:"<<k; if(ss[j]==s[k]) { flag=1; continue; } else { flag=0; break; } } } if(flag) return p; } …

Member Avatar for ArkM
0
143

The End.