1,426 Posted Topics
Re: could you please explain exactly what you mean. | |
Re: could you post the error that you are getting. or at least open your blinds ;) | |
Re: on line 159 you have [icode]score += 100;[/icode] and you haven't initialized it yet. then only time before line 159 that score is used is when it was declared as [icode]int score;[/icode].did you delete a [icode]score = 0;[/icode] when you added the enemy part? | |
Re: what do you mean by loop dies not exist? if you put [icode]!inFile.fail()[/icode] inside your while it doesn't work? | |
Re: where is the data vector in you matrix class definition. I'm seeing you using it in your constructors but its never defined. also in you operator= function you aren't copy the data from the other matrix. all you are doing is changing the size of the vector. | |
Re: strcmp takes is defines as [code=c++] strcmp(const char*, const char*) [/code] and you are trying to do [code=c++] strcmp(string, string) [/code] so what you need to do is convert the string to a char* and then use that for the strcmp function. Fortunately help does exist. The string type has … | |
Re: i think the error you are getting is on line 65. you are starting with the subscript 6 but i believe the vector has only 6 elements so the last subscript would be 5. why don't you just use push_back for each element instead of insert since you are adding … | |
Re: could you please post the errors you are getting? | |
Re: >>Hi I M Rameshwar Prasad Sahu From Bilaspur, Chhattisgarh, I M working as computer faculty and Here the solution of your question Libraby Management System. If You have any problem with this coding Email me your problem at: <<EMAIL SNIPPED>> My god how is this possible. I mean come on. … | |
Re: for virtual functions [url]http://www.codersource.net/c/c-tutorials/c-virtual-function.aspx[/url] as for splitting the files the .h function should have the deceleration of the class and the .cpp should have the definitions of all the class function. something like this [code=c++] //foo.h class Foo { public: Foo(); ~Foo() {} private: int bar; }; // foo.cpp Foo::Foo() … | |
Re: Another way to do this is have the whole name entered on one line than parse through the string and pull the names out of it. A good way would be to see how many space are in the string. if there are 2 spaces than you know you have … | |
Re: is plane a dynamically created array or just an array of objects? | |
Re: do you have to use a 2d char array? i would think it would be easier to use a string and vector and use the getline methode to extract from the file. something like [code=c++] vector<string> dictionary; string temp; while (getline(inFile, temp)) dictionary.push_back(temp); [/code] | |
Re: if you are talking about this line [code=c++] pv = &i [/code] then this is used to assign to the pointer pv the address of the variable i. thus making the void pointer an int basically if you are talking about [code=c++] void Foo(int & bar) {} [/code] then you … | |
Re: How big is the vector inside the vector? The main vector is of size 3 so the subscript [2] should be fine but I don't see anything for the size of each vector in distance. what would happen if you accesses distance[1][2]. Does that throw an exception? | |
Re: well for starters your constructor on line 24 is not right. you are calling the set functions but not passing anything into them. you should just initialize the member variables right in the constructor instead of calling your set functions. second you set numerator function will not allow 0 as … | |
Re: well it looks like you have a counter in each one. are they not counting correctly? | |
Re: Does this actually compile? In your encryption function you are overwritting the bounds of the encryptedChar string. I would suggest using the append function to add charactures to the string. Or make encryptedChar the same size as encrypt_code and then assign it with your index. | |
Re: i would use a while loop for your loop and have a counter variable. i would start the loop at the first posistion to delete than increment it by the value you entered first. i would check after incrementing to see if i exceded the size of the vector and … | |
Re: I belive you need to clear the input buffer before the second while loop | |
Re: Delcare your function before main and try to compile agian | |
Re: is it [code=c++] #include <Transport.h> // or #include "Transport.h" [/code] | |
Re: i looked up remove_if and they called the function without a & in front of the function. not sure if that will help [url]http://www.cplusplus.com/reference/algorithm/remove_if/[/url] | |
Re: we will assume the library is using 1 byte for each digit in the number you would need. then as 2 is multiplied by 2 each time it doubles and you get about 3 times before it adds another place to the number. so at best you would be looking … | |
Re: the simplest way i know to get every word by itself from input would be [code=c++] vector<string> words; string temp; while(getline(cin, temp, ' ') words.push_back(temp); [/code] | |
Re: take that second piece of code you have and turn it into a function in the first piece of code you posted. like this: [code=c++] #include <iostream.h> #include <conio.h> void WeeklySales(); main() { int number; cout << "******Sales System******"; do { cout << ("\n\n"); cout << "1. Display Company Logo.\n"; … | |
Re: is there any more to the lnk1120 error message or was that all the compiler said? also please use code tags | |
Hey all I have been writing my own implementation of a BigInt class and I think I have most of it down. I am using a vector<int> container for my number. I'm curious to what you guys think about. This is my first program using 1000+ lines of code. Please … | |
Re: first for your strncmp you need to make pass the string email_address as a char*. to do this you need to use the c_str() method [code=c++] strncpy(userId, email_address.c_str(), 9); [/code] second isalpha actually takes an int so you can only use a single character not a whole string so you … | |
Re: are you sure that function has to be part of your student class or is that a separate function to be called in main? | |
Re: well you can use getline with '-' as the delimiter so you don't need to check for the negative. also your function is returning void. are you sure you want to do that? I believe you would want to return the string to the function that called this function. | |
Re: yes you can acces the class as long as you pass it. a simple way to demonstrate this would be [code=c++] bool AttackMonster(monsters * monster, int indexOfMonster); int main() { bool result = false; int index = 0; monsters monter[325]; // load the array with all thge differnt monster types … | |
Re: could you please post the code that uses this line. | |
Re: you may also have to add a '' in between the dir and the file name unless the person enters the dir with a slash at the end | |
Re: You are mixing input types. After your call to cin >> tmp you need to clear the input buffer. You can use cin.ignore() for this. If that does not work narue has a good sticky thread on how to clear the input buffer that is very informative | |
Re: i would try changing this [code=c++] LList::LList() { this->size = 0; } // to LList::LList() { size = 0; } // and int LList::getsize() { return this->size; } // to int LList::getsize() { return size; } [/code] | |
Re: the garbage you are getting is because you declared the array to have 20 elements but you are only filling 6 of them. the rest are uninitialized. you could use a vector in this case and that will fix having to know the size because it can re size itself … | |
Re: if you are seperating the whole part and decimal part then i would make your routine for getting the number into its own function and then in main parse through the string untill you hit the '-' then save that substring as your whole part and the rest will be … | |
Hey All I am testing myself with making a big number class. Right now I'm just working with integers but I hope to expand it to floats as well. I am using a vector of integers for the container and i have run into a problem with my addition routine. … | |
Re: Since you are reading from a file you need [icode] #include <fstream> [/icode] also I would use an ifstream object such as [code=c++] ifstream& operator>>(ifstream &in, ArrayIntStorage &A) [/code] | |
Re: here is a good link to start with. [url]http://www.daniweb.com/forums/announcement8-2.html[/url] | |
Re: 2 things im seeing off the top is in your readin function after reading in the file data you delete the data in temp and than you delete the data in pc so you do all the work and then delete it all. second your printing function is named printf … | |
Re: your while loop isn't working like you think it is i believe. lines 50-61 should be in the while loop and you have them outside it. | |
Re: well if you want a pointer then i believe the syntax would be [code=c++] faculty * foo = new facilty; foo->mod[0].st[0].name; [/code] also please you code tags | |
Re: your check if either player has more than the points needed to win is not inside your do while loop. it is only checked before you enter the loop and then you go on forever. | |
Re: so if you have the string "hello" and the string "loot" it would become "helloot" since the ending "lo" of hello and the beginning "lo" of loot are the same? and "helloeDelhi" hase no over lap so it isnt truncated correct? | |
Re: i would suggest purchasing a new PSU. 500+ watts should be fine |
The End.