1,426 Posted Topics
Re: 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 … | |
Re: 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 … | |
Re: You could pipe the cmd text to a file and then parse that file for the information that you need. | |
Re: @ 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, … | |
Re: You are missing a return stament in your main function as well as a closing curly brace for the main function. | |
Re: 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 | |
Re: 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). | |
Re: Check this out [Click Here](http://www.parashift.com/c++-faq/inline-functions.html) | |
Re: What is fil3? You are oppening account.txt in `inFile.open("account.txt",ios::in);` | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: So what do you have? What problem are you experiencing? | |
Re: So besides the fact that your code is almost complete unreadable whats your problm? | |
Re: 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;` … | |
Re: Try putting the file were the .exe file resides. | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: 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`. | |
Re: what does the input to your program look like? | |
Re: 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 … | |
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 … | |
The End.