1,426 Posted Topics

Member Avatar for slowlearner2010
Member Avatar for slckrck89
Member Avatar for fellixombc

could you post the error that you are getting. or at least open your blinds ;)

Member Avatar for NathanOliver
0
415
Member Avatar for nola_Coder

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?

Member Avatar for NathanOliver
0
111
Member Avatar for evans007

what do you mean by loop dies not exist? if you put [icode]!inFile.fail()[/icode] inside your while it doesn't work?

Member Avatar for NathanOliver
0
109
Member Avatar for sgriffin

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.

Member Avatar for sgriffin
0
107
Member Avatar for spursfan2110

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 …

Member Avatar for JohnKSmith
0
89
Member Avatar for Phasa

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 …

Member Avatar for caut_baia
0
139
Member Avatar for deadelgabar
Member Avatar for bl@ck_d3ath-v2

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

Member Avatar for NathanOliver
-2
1K
Member Avatar for enigmaYes

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

Member Avatar for NathanOliver
0
246
Member Avatar for faaz

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 …

Member Avatar for NathanOliver
0
159
Member Avatar for newtoc_23
Member Avatar for umar__farooq
Member Avatar for NathanOliver
0
164
Member Avatar for johann_2

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]

Member Avatar for johann_2
0
130
Member Avatar for omgaga

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 …

Member Avatar for NathanOliver
0
76
Member Avatar for FotG2

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?

Member Avatar for daviddoria
0
216
Member Avatar for jeffcruz

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 …

Member Avatar for jeffcruz
0
174
Member Avatar for Kayano
Member Avatar for NathanOliver
0
142
Member Avatar for theblastedfool

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.

Member Avatar for theblastedfool
0
96
Member Avatar for Schrödinger

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 …

Member Avatar for Schrödinger
0
91
Member Avatar for blind122
Member Avatar for caut_baia
0
93
Member Avatar for bgx90
Member Avatar for NathanOliver
0
62
Member Avatar for Duki
Member Avatar for vidit_X
0
105
Member Avatar for smoothe19

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]

Member Avatar for mitrmkar
0
5K
Member Avatar for goldstmarc

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 …

Member Avatar for NathanOliver
0
192
Member Avatar for gregarion

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]

Member Avatar for NathanOliver
0
143
Member Avatar for Dinglish

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

Member Avatar for NathanOliver
0
118
Member Avatar for jessiko555

is there any more to the lnk1120 error message or was that all the compiler said? also please use code tags

Member Avatar for jessiko555
0
245
Member Avatar for NathanOliver

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 …

Member Avatar for NathanOliver
0
151
Member Avatar for rena0514

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 …

Member Avatar for Salem
0
186
Member Avatar for dragonflare

are you sure that function has to be part of your student class or is that a separate function to be called in main?

Member Avatar for NathanOliver
0
167
Member Avatar for sana zafar

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.

Member Avatar for sana zafar
0
98
Member Avatar for Whizzy

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 …

Member Avatar for NathanOliver
0
156
Member Avatar for Excizted
Member Avatar for Q8iEnG

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

Member Avatar for WaltP
0
164
Member Avatar for mn.balakumar

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

Member Avatar for NathanOliver
0
86
Member Avatar for bletchley

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]

Member Avatar for jonsca
0
127
Member Avatar for fugnut

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 …

Member Avatar for WaltP
0
86
Member Avatar for blind122

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 …

Member Avatar for WaltP
0
310
Member Avatar for NathanOliver

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

Member Avatar for NathanOliver
0
151
Member Avatar for rpowell16

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]

Member Avatar for rpowell16
0
102
Member Avatar for ttunstall07
Member Avatar for Bigojac2000

here is a good link to start with. [url]http://www.daniweb.com/forums/announcement8-2.html[/url]

Member Avatar for NathanOliver
0
190
Member Avatar for ravenrider

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 …

Member Avatar for Murtan
0
151
Member Avatar for fugnut

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.

Member Avatar for mitrmkar
0
115
Member Avatar for nike_jj4

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

Member Avatar for nike_jj4
0
86
Member Avatar for faaz

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.

Member Avatar for faaz
0
175
Member Avatar for pixelerator

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?

Member Avatar for pixelerator
0
114
Member Avatar for skunther

The End.