1,426 Posted Topics
Re: well the values s, cutoff and p are are not being declared. secondly what is the function rng()? also where are you using high and low? | |
Re: well if you want to store questions in a text file where the user can change them the i would suggest just writing a simple output protocol where it is outputted line by line like: What shape as 4 sides? 1)Triangle 2)Circle 3)Square 3 [INDENT][INDENT]make this line a blank line[/INDENT][/INDENT] … | |
Re: well it really depends on how you want 2 sale items to be added together. the function declaration you have looks good though. btw please use code tags. | |
Re: i guess someone didn't read the second post in the forum. :P | |
Re: the reason you would want to make your own is that with c++ the default will make an exact copy of the class and you will have two classes that point to the same memory address's. now if you delete the pointer in one class then the other class will … | |
Re: well a really easy way to fix this is if you can use 2 one dimensional arrays then store the first column in one array and the other column in the second array [code=c++] int column1[12], column2[12]; int i = 0; // open the file while (!inFile.eof()) // goes { … | |
Re: i take it you are trying to see if the user entered 150 or 175 as the rate and if they do not then tell them they have a wrong entry and re ask for the room rate a simple way for this would be to do this [code=c++] int … | |
Re: a good way to stay orginixed is to split your classes up into 2 files. a .h file that will for the deleeration of the class and a .cpp file that will hold the definition of the class and then you would include them into your main.cpp file such as: … | |
Re: um for each is not c++ built in keyword. are you using something else or some type of library? | |
Re: for your loop you should be using [icode] while(numRecords < 20) [/icode] that will fix running the array out of bounds. as Tom Gunn stated about iTemp and iNew they are being assigned a number to the fstream object on the value you got from the file. | |
Re: so you want to output the screen output screen to a file? | |
Re: from what i can gather from my msdn you will need to read the file file before you write to it so that the file pointer is at the end and will put any new text after everything in the file. you can use the ReadFile() function to read all … | |
Re: hey Shawn what exactly is your signature? sorry for going off topic. | |
Re: well if your using a microsoft complier the mfc is included im not quite sure about the other compliers though. i havent tried making an mfc program in anything other than microsoft visuall c++ 6.0 but with that complier it is very easy to create a simply visual c++ program … | |
Re: the easy way for you to not use the lowest score when you calculate the average is to sort your array to have the lowest score in the first element then use a for loop and start at the element after that. example [code=c++] int numberOfScores; float average; cout << … | |
Re: pulled this of my msdn maybe it will help you out Physical Disks and Volumes You can use the CreateFile function to open a physical disk drive or a volume. The function returns a handle that can be used with the DeviceIoControl function. This enables you to access the disk … | |
hi narue i would like to ask if this method should be called after ever cin statement? the reason i ask this is that if i write a program and i have 2 [icode] cin >> text; [/icode] statements then at the end before my [icode] return 0; [/icode] i … | |
Re: try this thread [url]http://www.daniweb.com/forums/thread70096.html[/url] ![]() | |
Re: i would make sure that time1.h is in a directory where the compiler looks for the files to include. the compiler might not be finding the include file. I've had this problem with msvc 6.0 but I've never used g++ | |
Re: alright so you have no code to demonstrate that you have tried recursion or iteration. the iteration is the simple and the fast way of doing this. the logic with a for loop is to ask the user number they want to get and then loop up to it. so … | |
Hi all. i am writing a simple log in program and i would like to have a class for users that stores the user name and the password as strings. after i have a user created i would like to output the class with the ios::binary flag set and store … | |
Re: the problem i see is that your treating the char as it was a MyString. for chars you can do this. [code=c++] MyString& MyString::operator=(const char* rightOp) { delete []stringstorage; stringstorage = new char[sizeof(rightOp)] *stringstorage = *rightOp return *this } [/code] i removed the first const because with assignment you have … | |
Re: [QUOTE=oop'stechie;911837]u r talking about four million,thats completly out of range for an int declaration...........whether u take long int it will not work,becouse long int don't have that much range in 32 bit processor.......... but it might work in 64 bit u may try[/QUOTE] the max of a 32 bit unsigned … | |
Re: well a multidimensional array has a max that is equal to the max of each dimension multiplied together. so if your array is array[10][5][20] then you would do 10*5*20 to get the max which would be 10000. this works no matter how many dimensions you have. so in your program … | |
Re: in every header file it is a good idea to use inclusion guards. so to stop it from getting defined all the time just put [code=c++] #ifndef RANDOMC_H #define RANDOMC_H // all the code in randomc.h goes here #endif [/code] this will make sure that the file is only included … | |
Re: well from what i can see you have an hEdit in the SaveTextFileFromListBox function but you are not passing it into your DoFileSave function so the program doesn't know what it is i.e. not defined. try passing it into the function and see what happens | |
Hi i am building a program that will take the text of a supplied file and encrypt using a password then save the encrypted text in another file. To decrypt the file you must provide the same password used to create the file. the program encrypts the text at a … | |
Re: use a cout statement asking the user what type of severity they want like [code=c++] //... std::string choice; cout << "Please enter the severity you want.\n"; cout << "Your choices are: warning, success, information, and error: "; cin >> choice //... } [/code] | |
Re: i noticed in your code that you posted that in basetsd.h int the #if statement [icode] #if ( 501 < __midl ) [/icode] there are typedef's for a LONG_PTR and a ULONG_PTR which might be giving you the error since you are typedefing them again in your xvt_type.h file | |
Re: when you use << it looks for a method to ouput the data. since you are trying to output the class the compiler looks for a method to ouput but since yo dont have one you are getting this error. you need to overload the << operator so it displays … | |
Re: there is a function in the <string> header file called _stricmp that will convert all the characters to there lowercase. the function is defined as [code=c++] int _stricmp( const char *string1, const char *string2 ); [/code] this function will return 0 if the strings are equal. less than 0 and … | |
Re: are you getting the same number for every value? are you sure that the size of each element is 2? | |
Re: i would use the getline function and make the delimiter the space between each element then store them in separate arrays | |
Re: the problem is that when you say [icode] temp = 3 + (text[i] - '0'); [/icode] in your for loop you are constantly setting the string to just one character. to build the string i would either use [icode] temp += 3 + (text[i] - '0'); [/icode] or [icode] temp.append(3 … | |
Re: if you want to assign the last name to be equal to DELETED then you would want to have [code=c++] List[K].setLast("DELETED"); [/code] | |
Re: well I'm not to sure about FILE but i know that if you do this you can loop through the file until the end. [code=c++] ifstream fin(*infile); while (!fin.eof()) { for (int count=0; count < 4; count++) { for (i = 0; i < SIZE - 1; i++) { fin … | |
Re: sorry posted on accident and i cant find out how to delete it | |
Re: what i would do is get rid of the second newline in [icode] DataBase << Password << "\n\n"; [/icode] and have [icode] DataBase << Password << "\n"; [/icode] with one newline in the join function so that file goes username password username password ... then in login you could use … | |
Re: if you mean that you want to round the number to a specific number of decimal places you might want to make a char array and use _gcvt() to store in the number of digits you want. for your example if you want pi to 5 places you could do … | |
Re: in case 1 you should have the price of the tickets added to the total so that way evertime someone bys a ticket the total is updated. | |
Re: when you declare the class you can do this [code=c++] template<typename T, typename T> class matrix { //... // or template <typename T, typename C> class matrix { //... [/code] the first example both numbers passed will be the same type that you chose the second example the first and … | |
Re: on line 47 you have [code=c++] temp.estimatedTime = h.estimatedTime + h.estimatedTime; [/code] all this is doing is adding the term [icode] h.estimatedTime [/icode] to itself effectively doubling it. if you want to add the first and second terms you can do [code=c++] temp.estimatedTime = this->estimatedTime + h.estimatedTime; [/code] this will … | |
| |
Re: just for your information you do not need to implicitly define the delimiter as a newline in getline() it is already set there and if you want to change it the you must specify what you want. at least that is according to the msdn for visual c++ 6.0 professional | |
Re: you need to use the distance formula to get length of the legs of the triangle and then the Pythagorean theory to see if its a right triangle. distance formula = sqrt( (x2-x1)^2 + (y2-y1)^2 ) ) Pythagorean theory = a^2 + b^2 = c^2 | |
Re: if this computer is a tower and not a laptop you can open the case and there will be a jumper on the board that will clear the bios password. you will have to look up the motherboard specs tough to find out where the jumper is at. | |
Re: but he said he needs to convert the inputed number so wouldnt that imply that he needs to use cout to ask for the number and cin to get it? | |
Re: for this part of code [code=c++] char * pChar[255]; pChar = new char[255]; [/code] you do not want to declare pchar with its elements. you save that for the new operator part. so you would want to do this [code=c++] char * pChar; pChar = new char[255]; [/code] also when … | |
Re: im not exactly sure but i dont think you can pass an oppened ifstream object. try opening the ifstream object in your build function | |
Re: he told you not to put the type in when you call the function not when you declare or define the function [code=c++] //... StuRead(students); // good no data type before variable //... void StuRead(ifstream &inFile, studentType students) // good data types befor the variables { //... [/code] hope this … |
The End.