1,426 Posted Topics

Member Avatar for tharindu123
Member Avatar for ansar.ahmed.7967

All of your code is compiled by the compiler. As far as you loop question is concerned look at this: for (int i = 0; i < 10; i++) { for (int j = 0; j < 5; j++) { std::cout << j * i << std::endl } } The …

Member Avatar for NathanOliver
0
115
Member Avatar for Vasthor

So you have a set that hold all of the line numbers a give word appears? Then you need to store all of the words in that text with thier related set in another container? If that that case the map should be keyed by the word and the set …

Member Avatar for NathanOliver
0
208
Member Avatar for alhawsa
Member Avatar for Suzie999

You could pipe the cmd text to a file and then parse that file for the information that you need.

Member Avatar for Suzie999
0
321
Member Avatar for Damian_2

@ OP if you have a compiler that supports c++11 than you can use the std::map initializer list constructor. It would change your code to loo like this void ArcherArmor::ArcherArmor_shop(){ soldier_armor = {//name, damage, price std::make_pair(1, Armor("Meito Ichimonji", 4, 150, 1)), std::make_pair(2, Armor("Shusui", 10, 230, 2)), std::make_pair(3, Armor("Apocalypse", 16, 300, …

Member Avatar for Damian_2
0
745
Member Avatar for skylinedrifter

You are missing a return stament in your main function as well as a closing curly brace for the main function.

Member Avatar for Slavi
0
194
Member Avatar for Learner010

The only way I know to make a pointer array with x values is the following. int * numbers = new int[x]; // where x equals some integer number

Member Avatar for deceptikon
0
157
Member Avatar for prashantsharmazz

Okay. what do you have so far? You can take a look at [this](http://www.cs.mtu.edu/~shene/COURSES/cs201/NOTES/chap04/arms.html).

Member Avatar for NathanOliver
0
173
Member Avatar for Bhat kamran
Member Avatar for Sanjeetjmp

Check this out [Click Here](http://www.parashift.com/c++-faq/inline-functions.html)

Member Avatar for Ancient Dragon
0
219
Member Avatar for javed.iqbal.3979

What is fil3? You are oppening account.txt in `inFile.open("account.txt",ios::in);`

Member Avatar for NathanOliver
0
152
Member Avatar for nhrnjic6

Get rid of line 14. On the last time through your loop you will reach the end node which shouold be null. Then line 14 tries to access it and since it is null it will throw a fault.

Member Avatar for nhrnjic6
0
321
Member Avatar for rowen_1
Member Avatar for CoolAtt

Try this and let me know If you get the second cout statement #include <iostream> using namespace std; class A { private: int _dmember; public: void func() { cout<<"Inside A!! "<<endl; cout<<_dmember; // } }; int main () { A *a=NULL; a->func(); // prints "Inside A!!!" cout << "We are …

Member Avatar for CoolAtt
0
316
Member Avatar for marc.orocay

No one is going to do your work for you. There is little difference in a do-while loop compared to a for loop. Yopu just have to make your own counter and take care of it with a do while loop versus a for loop. Here is how you can …

Member Avatar for NathanOliver
-2
222
Member Avatar for Schol-R-LEA

I'll throw in my two cents as well. I am currently going to college here in the states and from what I have seen in my classes most programmers are doomed. Our C++ class was basically C with classes at the end. I had a couple of java classes as …

Member Avatar for Ancient Dragon
1
2K
Member Avatar for maryyy
Member Avatar for learncoding
Member Avatar for merry gold

So besides the fact that your code is almost complete unreadable whats your problm?

Member Avatar for Schol-R-LEA
0
149
Member Avatar for richieking

I actually prefer seeing `int clocks_per_ms = CLOCKS_PER_SEC / 1000;` to `int clocks_per_ms = 1000;`. It lets the person reading the code now exactly what you want to do. Also since it is a constant being divided by a constant it will be optimized away to `int clocks_per_ms = 1000;` …

Member Avatar for deceptikon
0
2K
Member Avatar for princessophia
Member Avatar for Jiggle

this is from lazyFoo's faq page Q: Can I use your code to make a game? A: Basically my rules are: 1) If you're using it for a closed source program, go nuts. 2) If you're using it for an open source program, please cite the chunks of code you …

Member Avatar for Gabriel_2
0
332
Member Avatar for bugmenot

This is from line 023 double AreaOfTriangle This is from line 102 double AreaOfTrianglw Notice anything wrong? Also dont hijack and old thread with a new problem. Start a thread instead.

Member Avatar for NathanOliver
0
2K
Member Avatar for pphamtuan

What is the full error you are getting. Just posting 400+ lines of code and a partial error message as your title generally doesnt get you very far.

Member Avatar for Ancient Dragon
0
400
Member Avatar for chubbyy.putto

In your function you need to declare a local variable to hold the sum of the array elements and then return that. You do not want to store the sum in `n`.

Member Avatar for Learner010
0
106
Member Avatar for furalise
Member Avatar for Tyler_1

How would you write code without using functions or classes? From what I know about code creation you want to compartmentalize your code as much as possible. Breaking it up makes it easier to maintain and affords you the ability to change code in one spot and have it apply …

Member Avatar for Tumlee
0
318
Member Avatar for NathanOliver

Hey Daniweb, I have recently started working with threads in the c++11 library. I started with a simple dispatch mechanism where I have a queue and that would get passed to the threads and the threads would take turns emptying the queue. Since each thread needs to share the queue …

Member Avatar for NathanOliver
0
331
Member Avatar for Elias_2

The End.