1,426 Posted Topics

Member Avatar for skiing

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?

Member Avatar for kvprajapati
0
130
Member Avatar for aliaks

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] …

Member Avatar for NathanOliver
0
147
Member Avatar for tarekwehbe

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.

Member Avatar for NathanOliver
0
75
Member Avatar for 4101
Member Avatar for siddhant3s
0
95
Member Avatar for harry010

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 …

Member Avatar for harry010
0
196
Member Avatar for DrDeadite

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 { …

Member Avatar for NathanOliver
0
90
Member Avatar for nova2177

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 …

Member Avatar for nova2177
0
111
Member Avatar for Smoking Bros

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: …

Member Avatar for mrnutty
0
508
Member Avatar for johnysums

um for each is not c++ built in keyword. are you using something else or some type of library?

Member Avatar for MosaicFuneral
0
130
Member Avatar for teddyg18

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.

Member Avatar for teddyg18
0
160
Member Avatar for atch
Member Avatar for Narue
0
138
Member Avatar for goody11

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 …

Member Avatar for bdusablon
0
128
Member Avatar for Ola1
Member Avatar for NathanOliver
0
119
Member Avatar for seakayaker

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 …

Member Avatar for Stefano Mtangoo
0
152
Member Avatar for pltndragon

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 << …

Member Avatar for NathanOliver
0
2K
Member Avatar for crazylunatic

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 …

Member Avatar for NathanOliver
0
1K
Member Avatar for NathanOliver

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 …

Member Avatar for NathanOliver
0
127
Member Avatar for super.mina

try this thread [url]http://www.daniweb.com/forums/thread70096.html[/url]

Member Avatar for jencas
0
89
Member Avatar for OwenRoberts

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++

Member Avatar for jesseb07
0
387
Member Avatar for funjoke88

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 …

Member Avatar for NathanOliver
0
470
Member Avatar for NathanOliver

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 …

Member Avatar for NathanOliver
0
387
Member Avatar for lancevo3

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 …

Member Avatar for wildgoose
0
248
Member Avatar for Ather14

[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 …

Member Avatar for NathanOliver
0
181
Member Avatar for XodoX

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 …

Member Avatar for NathanOliver
0
103
Member Avatar for somyasinha

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 …

Member Avatar for u8sand
0
140
Member Avatar for goody11

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

Member Avatar for NathanOliver
0
131
Member Avatar for NathanOliver

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 …

Member Avatar for NathanOliver
0
152
Member Avatar for alka123456

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]

Member Avatar for NathanOliver
0
239
Member Avatar for imaloner

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

Member Avatar for imaloner
0
819
Member Avatar for allsey_1987

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 …

Member Avatar for allsey_1987
0
86
Member Avatar for theashman88

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 …

Member Avatar for theashman88
0
321
Member Avatar for real_castilla

are you getting the same number for every value? are you sure that the size of each element is 2?

Member Avatar for real_castilla
0
134
Member Avatar for LostByte

i would use the getline function and make the delimiter the space between each element then store them in separate arrays

Member Avatar for Topi Ojala
0
129
Member Avatar for Koldsoul

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 …

Member Avatar for NathanOliver
0
4K
Member Avatar for GrilledTuna

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]

Member Avatar for GrilledTuna
0
94
Member Avatar for jtltgl

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 …

Member Avatar for jtltgl
0
132
Member Avatar for HunterFish
Member Avatar for Deme

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 …

Member Avatar for valtikz
0
988
Member Avatar for Akis2000

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 …

Member Avatar for Akis2000
0
143
Member Avatar for Bemani_lover

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.

Member Avatar for NathanOliver
0
134
Member Avatar for Talguy

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 …

Member Avatar for Talguy
0
91
Member Avatar for JLopeman

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 …

Member Avatar for NathanOliver
0
100
Member Avatar for sabian4k
Member Avatar for l3vi

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

Member Avatar for l3vi
1
1K
Member Avatar for SallyJ

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

Member Avatar for ArkM
0
2K
Member Avatar for angelocmp

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.

Member Avatar for NathanOliver
0
132
Member Avatar for nishantsharma

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?

Member Avatar for tux4life
0
241
Member Avatar for Deme

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 …

Member Avatar for Deme
0
2K
Member Avatar for Jyncus

im not exactly sure but i dont think you can pass an oppened ifstream object. try opening the ifstream object in your build function

Member Avatar for MrSpigot
0
114
Member Avatar for Adexter

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 …

Member Avatar for NathanOliver
0
125

The End.