1,426 Posted Topics

Member Avatar for atticusr5

yes you need to declare first last and x inside your function in order to use them. what SasseMan was saying is you need to define the operator = for your class. it is a god idea to write your own because the default just dose a shadow copy of …

Member Avatar for SasseMan
0
142
Member Avatar for wolfkrug

I'm not seeing a main function anywhere. do you have this code in a main function?

Member Avatar for wolfkrug
1
178
Member Avatar for DavidDD

i would have sGuess be a char variable in this case. as stated earlier there may be multiple occurrences of the guess letter in the random word. for that reason you would either need another array to keep track of the positions in the random word or you could use …

Member Avatar for DavidDD
1
129
Member Avatar for foxmulder
Member Avatar for metalclunch

the problem you are having is on line 19. when you declare a 2d array you declare the rows and columns of the array. your statement [icode] int PlayerInfo[MAX_PLAYERS][pInfo]; [/icode] is saying define an array of 32 rows and pInfo columns. since pInfo is a type and not a value …

Member Avatar for metalclunch
0
1K
Member Avatar for JungWoo

the problem is on line 70 and 76. on line 76 you have [icode] cout<<name.top()<<" "; [/icode]. here you are outputting the top object int the stack which is of type Lexeme. you either need to define and operator<<() function for your class or call an accessor like [icode] cout<<name.top().getLex()<<" …

Member Avatar for NathanOliver
0
96
Member Avatar for ramsdellcp

it looks like you are doing your checking of the guess in the blankspaces function. so if that is the case then i would add a line in you else statement of the [icode] if(flag) [/icode] statement to increment inCorrectGuess [code=c++] //... if (flag) { //... } else { cout …

Member Avatar for NathanOliver
-1
119
Member Avatar for Star Frost

have you tried using vectors? you could store the separate strings in a vector just like an array and pass the vector into the function. also is your function did you want to take in an array of strings or a single string at a time. you only need one …

Member Avatar for Star Frost
0
127
Member Avatar for charmedangerous
Member Avatar for Grn Xtrm
0
94
Member Avatar for Ponomous

you need to move your declaration of y to be before the do statement on line 23. the reason is that when the compiler hits the while statement it hasn't seen the deceleration for y so it doesn't know what it is. also a easy way to do the while …

Member Avatar for NathanOliver
0
113
Member Avatar for dqddani

well one good practice to get into is to set your pointer to null after you delete it [code=c++] int * a = new int[30]; delete [] a; a = NULL; //or a = 0; [/code] this will make sure the the pointer no longer points to where it used …

Member Avatar for jbennet
0
516
Member Avatar for uzimuzi

also you have not terminated the array with a newline value so cout does not know where the end oh the char array is.

Member Avatar for uzimuzi
-1
331
Member Avatar for matthewl

i use 2 computers. one desktop and one laptop. to be fair though the desktop has 3 screens that i use :)

Member Avatar for jbennet
0
301
Member Avatar for willywonka

a way you can do this would be to have a void check function inside a while loop in your main function. [code=c++] void CheckInput(char[80], bool*); int main() { char[80] cake; bool good = false; while (!good) { cout << "please enter a cake: " cin >> cake; CheckInput(cake, &good); …

Member Avatar for Vani3863
0
175
Member Avatar for BeyondTheEye

well with polymorphism you do need to use virtual functions in order for the program to know which functions to use. since it isn't virtual it is calling the horse operator=() function instead of the pony's operator=() function. there is a little more overhead with virtual function because of the …

Member Avatar for BeyondTheEye
0
125
Member Avatar for patman50

i assume you didn't read the second post on the page where it says we only give help on homework to those who show effort. do you have any code and having a problem with it? do you have any idea what the logic should be? variables?

Member Avatar for Grn Xtrm
0
124
Member Avatar for The Dude

woot 7 right. and im a leader with a 64. not quite sure what the scale is out of though.

Member Avatar for vmanes
0
70
Member Avatar for Wolf CCMLG

well you being asked to provide the information in the constructor so you should have something like [code=c++] class DayOfYear { public: DayOfYear(int day) { day = y; } //... }; [/code] the you initilize the class like [code=c++] int main() { int day; cout << "enter the day: "; …

Member Avatar for Lerner
0
1K
Member Avatar for NathanOliver

hi all. I'm not sure if its possible but can you call a different constructor inside a constructor of a object? ie can i have different constructors call a single constructor to set up the object [code=c++] class foo { public: foo(int) foo(double) //... }; foo::foo(int number) { this = …

Member Avatar for mrnutty
0
120
Member Avatar for shopnobhumi

well i got it running. i deleted the [inlinecode] #include "stdafx.h" [/inlinecode] and changed [inlinecode] qu_main(argc, argv) [/inlinecode] to [inlinecode] int main() [/inlinecode]

Member Avatar for NathanOliver
0
116
Member Avatar for complexcodes

in your if statements in your maze traverse function you have [inlinecode] (x+1, y) != 'A' [/inlinecode]. im not quite sure what this is. did you mean to do [inlinecode] if (mouse[x+1][y] != 'A') [/inlinecode] also on line 38 you have [inlinecode] if (maze[x][y] == 'T') [/inlinecode] but there is …

Member Avatar for complexcodes
0
183
Member Avatar for NathanOliver

Hi all. I am currently writing a large number class and was curious if I should use a template. I am setting up my constructors and I have one for a string and i was thinking i could use a template for a constructor so it can take in an …

Member Avatar for NathanOliver
0
144
Member Avatar for buriza

whet testing single chars you need to use the single quote such as [code=c++] if (op == '+') // this is okay if (op == +) // this is not okay [/code] also when you are testing conditions you are using a single =. testing equality in c++ is done …

Member Avatar for NathanOliver
0
100
Member Avatar for Sobakaa

i noticed on line 17 you a creating a new SYM object. have you tried using the new keyword? [code=c++] SYM * temp = new SYM[N]; // using the size you passed into the function for the array [/code]

Member Avatar for Sobakaa
0
112
Member Avatar for buriza

also line 30 should be [inlinecode] size = arraysize [/inlinecode] not the other way around.

Member Avatar for Sky Diploma
0
93
Member Avatar for AirGear

you really don't need to declare the size of the string when you create it. it is good practice to do so but the string will automatically re size itself when it needs to do so. this will make a little performance hit though.

Member Avatar for AirGear
0
249
Member Avatar for Wolf CCMLG

that is the problem [code=c++] cout << 'a'; // good cout << ' '; // good cout << 'ab'; // bad cout << ' '; // bad [/code]

Member Avatar for vmanes
0
145
Member Avatar for 2ndmiltia

you can have the input statement inside the loop [code=c++] int accnum; int accountnum[1000]; for (int i = 0; i < 100; i++) { cout << "please enter an account number: "; cin >> accnum accountnum[i] = accnum; } [/code]

Member Avatar for NathanOliver
0
289
Member Avatar for AnGuRuSO

the problem with the line of code you are using is that it is calling multiple functions. when the program runs it will take the return of the function and instead of keeping it in the registry it will put it into the ram which will truncate the number and …

Member Avatar for NathanOliver
0
118
Member Avatar for kele1

also you are starting the variable heads at one which will throw off you answer. you should initialize both heads and tails as 0.

Member Avatar for NathanOliver
0
234
Member Avatar for hurbano
Member Avatar for ellimist14

where are you setting the emp in the node. i see this block for file input [code=c++] while (fin >> number) { head = new LISTNODE(emp , head); } [/code] but with this you are not doing anything. first you need pull the information into your employee struct and then …

Member Avatar for NathanOliver
0
89
Member Avatar for yakovm

wehat error arer you getting. also when you define a template you would normaly use the syntax [code=c++] template <typename T, typename C> class Template { //... }; [/code]

Member Avatar for mrnutty
0
118
Member Avatar for Rastafari

well if your complier is compiling project01.cpp be for your main.cpp file then it doesn't know what MAX_COLS is yet. try moving the declaration into the project01.cpp file and see what happens

Member Avatar for VernonDozier
0
116
Member Avatar for ellimist14

well you could use the stl such as a vector or list or if your not allowed to do so you could copy the array into a new array skipping the one you want deleted and then delete the original array then return the new array.

Member Avatar for vmanes
0
78
Member Avatar for invisi
Member Avatar for Ancient Dragon

i found this site and it has g++ for Linux [url]http://gcc.gnu.org/wiki/GFortranBinaries[/url]

Member Avatar for Nick Evan
0
259
Member Avatar for shadwickman

you cant have an undefined amount of variables in function deceleration. you must declare what the function returns and all parameters the function takes. if you want to send a few or alot of one type of thing i would try using an array of some sort like [code=c++] void …

Member Avatar for shadwickman
0
167
Member Avatar for kelvinnvl

sorry but your post doesnt make sense. if we use 2/5 - 1/2 with your formula we get: numerator = (2 * 2) - (1 * 5) = 4 - 5 = -1 denominator = (2 * 5) = 10 so your fraction should be -1/10. not sure why you …

Member Avatar for siddhant3s
0
170
Member Avatar for Ali22615

so your not sure how to get the abs_minimum? arent you calculating it in you next function [code=c++] if (count <= 0) { count = 1; total = r; tinyest = r; largest = r; return; } count = count + 1; total +=r; if (r < tinyest) { tinyest …

Member Avatar for Ali22615
0
2K
Member Avatar for vijay4vin
Member Avatar for Lukezzz

well if you want to check for a " in a string then you can write. [code=c++] if (somestring[n] == ' " ') // i put a space between the single quotes and the double quote so you could see it. in your program just put '"'. { //... [/code]

Member Avatar for Lukezzz
0
98
Member Avatar for Sune

i had a similar problem writing a string to a file and i got some good advice. [url]http://www.daniweb.com/forums/thread203217.html[/url]

Member Avatar for Sune
0
149
Member Avatar for Natique

i think there is a win API function to see what programs are running but i cant remember. have you thought about multithreading instead?

Member Avatar for Natique
0
196
Member Avatar for Nogat21
Member Avatar for osan

at what line in your code the the assertion happen? also is the value for Ypix what you see when the debugger gets to that line? if show it is showing you the value of Ypix before it is assigned to 0.

Member Avatar for Dave Sinkula
0
290
Member Avatar for alexa12345

well when i add you number together and i dived by 5 I'm getting 8.004. so with your round function you would have ((8.004 * 100) +.5) / 100 = (8.4 + .5) / 100 = 8.9 / 100 = 8.009. with the floor of 8.009 being 8. I'm not …

Member Avatar for tux4life
0
134
Member Avatar for Nogat21

have you tried making your output stream a fstream like your input stream and using the write() function?

Member Avatar for Nogat21
0
89
Member Avatar for esesili

my advice would be to add a member variable to the patient class of type doctor that you assign when you get a doctor. this way you could call the member doctors get fee function. [code=c++] class Patient { public: // ... void SetDoctor(Doctor & doc) { doctor = doc; …

Member Avatar for NathanOliver
0
124
Member Avatar for muzhe

as ancient dragon said you need 2 char[]'s. one for the fully assembled file name and one for the user supplied file name. [code=c++] char filename[30]; // used for the total filename char FileName[20]; // used to get the filename from the user int a,b,c; cout << "please enter the …

Member Avatar for Ancient Dragon
0
813

The End.