-
Replied To a Post in two definitions of string?
Define by what you mean with: >if I want to use string methods, I #include <string> right? If you want to use anything release to a `std::string` or `std::wstring` then … -
Replied To a Post in two definitions of string?
`string` is defined in <string> and the defenition of `string` is `typedef basic_string<char> string;`. `string` is just a typdef and there is no actual string class in the standard. Whenever … -
Replied To a Post in Why do I need to close files twice??
The since you are using operator bool it will only be false when `badbit` and or `failbit` is set. The first time you close the file and evaluate operator bool … -
Replied To a Post in templete
Here is a good reference site: http://en.cppreference.com/w/cpp/language/template_parameters -
Replied To a Post in not able to save a file using button
@basit_3 you need to convert the `String^` to a `std::string` if you need want to use `std::ofstream` you con use this to convert the string(source: [MSDN](https://msdn.microsoft.com/en-us/library/1b4az623.aspx)): // convert_system_string.cpp // compile … -
Replied To a Post in simple program
Okay I'm done. That wasn't to hard. -
Replied To a Post in <vector>
Now that we have C++11 there are two options when you want an array object and don't want to use a native array. If you want an array of a … -
Replied To a Post in handling .h and .cpp linkage in different IDEs
More than likely cygwin is using some command to compile and that command doesn't change and either needs to be changed by you or can't be changed causing this issue. … -
Replied To a Post in handling .h and .cpp linkage in different IDEs
You should never include a .cpp file in another file. .cpp files should include .h/.hpp files and then all of those .h/.hpp and the .cpp file get compiled together to … -
Replied To a Post in Digital clock
What no one helped you the [first time](https://www.daniweb.com/software-development/cpp/threads/495354/digital-clock) so you are trying again? It's been 5 days and all you have come up with is "give me the code". -
Replied To a Post in push_back
The `push_back()` function of standard container appends to the end of the container the value passed to it. If the `size()` of the container equals the `capacity()` of the container … -
Replied To a Post in Project Euler - 09
Don't use `goto`. In this case to get out of your nested loops just use `return a*b*c;` where you have `goto End_of_Loop;`. There is no point exiting out of the … -
Replied To a Post in do while and while do loop
@rubberman According to the standard 3.6.1.5 main has an implicit `return 0;` if one is not provided >A return statement in main has the effect of leaving the main function … -
Gave Reputation to Moschops in Netbeans C++ Random number generator
I would be remiss if I did not point you at this: https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful I would go so far as to say never use `rand()`, even in toy programs just for … -
Replied To a Post in warning: variable set but not used
Can you post the code that is giving you the warning? If you never use `number2` then you should be able to just get rid of it. -
Replied To a Post in binary to decimal
You are pushing back the number on line 19 in your second code block. Get rid of that and you should be fine. cout<<"Enter a nonnegative integer:"; cin >> num; … -
Replied To a Post in Calculator with function
1) Open program to write code 2) Write code 3) Compile code 4) If you have compiler errors fix them and go to step 3 else continue 5) Run code … -
Replied To a Post in Tic Tac Toe Pseudocode
So what part is giving you a problem? -
Replied To a Post in C++ Minimum distance between cities and minimum travel time error
Didnt like your [downvote](http://stackoverflow.com/questions/29375458/c-minimum-distance-between-cities-and-minimum-travel-time-error)? -
Gave Reputation to Schol-R-LEA in High Fashion Department Store program to produce its monthly bills
<RANT> Something has been nagging me about this problem set since it was first brought up, and I think I've figured out what it is: the assignment itself. It's just … -
Created Quality Of Post From New Users
Has anyone noticed that there seams to be a large number of new users that are just copy and pasting their homework requirements into their post and that's it? Do … -
Replied To a Post in Fibonacii at its best
I just want to point out that if part of the requirement is to not use any dynamic memory allocation you shouldn't be able to use a vector. A vector … -
Replied To a Post in locating the header file(msoftcon.h) in a program using console graphics li
You need to add them to the solution. -
Replied To a Post in storing data in a array of struct
You don't have any structs. Are you trying to sort parallel arrays? -
Replied To a Post in Frequency problem?
You are going to have to loop through your data and find the min and max frequency. Then you have to loop through your array and print out all of … -
Replied To a Post in 42
I took it as this was going to be about the answer to [Life, The Universe and Everything](https://www.google.com/search?q=the%20answer%20to%20life%20the%20universe%20and%20everything&rct=j). -
Replied To a Post in 42
Repeating the same bad question isn't going to help you. Take a look at the [rules](https://www.daniweb.com/community/rules) and also see [how to ask a good question](https://www.daniweb.com/software-development/cpp/threads/78223/read-this-before-posting-a-question) -
Replied To a Post in Problem
To loop a whole program this is what I use: char continue; do { // program code goes here std::cout << <<"Press 'Y' to repeat and 'N' tp exit\n"; std::cin … -
Replied To a Post in array structure
Did you try to [google](http://lmgtfy.com/?q=passing+arrays+to+functions+c%2B%2B) that? -
Replied To a Post in PoDoFO build on Visual studio
Is the `podofo.lib` file located in the directories you have listed? -
Replied To a Post in Power in C++
Please detail what the problem is, what you have tried to solve it and any errors you are getting with the code you have. -
Replied To a Post in C++ Program Segment output
Why dont you compile it and find out? -
Replied To a Post in Dimensional Arrays
This is why [proper indention](http://en.wikipedia.org/wiki/Indent_style) is so important. -
Replied To a Post in Recursive Function 3^n
Does line 7:`int func(int);` look the same as line 22:`int func(int base, int power)`? -
Replied To a Post in C++ Programming
Congratulations. C++ is a very complex and powerfull language. If you are looking for reference on how to learn C++ I would visit [here](https://www.daniweb.com/software-development/cpp/threads/70096/c-books) -
Replied To a Post in C++ codeOutput
Why dont you run it an find out? -
Replied To a Post in virtual consructors and destructors
@serpi90 I think you are confusing how derived objects get created. If you have: class A { A() { /*do super complicated stuff in here to set up A*/ } … -
Replied To a Post in What is the Meaning Of *(ushort* + ushort) = uint?
`*(C + B) = A;` = `C[B] = A;` `*(G + F + 1) = E;` = `G[f+1] = E;` -
Replied To a Post in virtual consructors and destructors
Why would you have a virtual constructor? The reason you use `virtual` is to create a virtual table so that when a function is called from a pointer to a … -
Gave Reputation to iamthwee in "How to write three digit/two digit/one digit number as words
Please find attached the solution: int main() { int number; cin>> number; cout<<endl; cout<<"the number in words"; return 0; } Note: not compiled or tested! -
Replied To a Post in password
With the number of people posting just their homework maybe the instructors have noticed that and made the assignments easier to give us a break ;) -
Replied To a Post in problem can't solved :S "help"
And? Is there a problem or you just showing the final code? I do think `while (MinutesOfWork > MinutesVisit);` should be `while (MinutesOfWork >= MinutesVisit);` -
Replied To a Post in problem can't solved :S "help"
You should not be getting any input from the user. You need to figure out how many appointments the sales person can do per day. Once you know that then … -
Replied To a Post in Finding the oldest memeber
Did you try to do this with pseudocode to see what the operations are? The folowing pseudocode should help you with how you need to write the program. number age … -
Replied To a Post in parking garage
This is not a code writing service. If you have code and it is giving you a problem then post the code and what the problem is. No one here … -
Replied To a Post in counting change
This is not a code writing service. If you have code and it is giving you a problem then post the code and what the problem is. No one here … -
Replied To a Post in assignment operator overlaoding in context of different objects
Can you post the code you have now? It's hard to read your screen from here. -
Replied To a Post in Finding the oldest memeber
I'm pretty sure this was given to you to answer. -
Replied To a Post in assignment operator overlaoding in context of different objects
When doing operations like this you should look at using the [copy and swap idiom](http://stackoverflow.com/a/3279550/4342498). -
Replied To a Post in Determine the even number and sum of all even numbers
I would think and decent compiler would make `even % 2` and `even & 1` the same operation. My rule of thumb is write clear and legible code. This will …
The End.