Forum: C++ 11 Hours Ago |
| Replies: 11 Views: 133 As a mod I'm here to make sure people follow the rules (http://www.daniweb.com/forums/faq.php?faq=daniweb_policies). I gave you a warning to put in some effort and to keep it pleasant. You failed to... |
Forum: C++ 11 Hours Ago |
| Replies: 11 Views: 133 So with 'i just want to finish this assignment' you mean : 'i just want YOU to finish this assignment'?
I suggest you start putting in some effort from now on. Narue gave you some good advice, and... |
Forum: C++ 14 Hours Ago |
| Replies: 7 Views: 154 Do do not want to put the implementation of your code inside you header file. This file is for declarations only.
like this for example:
file.h:
class foo
{
private:
int n; |
Forum: C++ 16 Hours Ago |
| Replies: 2 Views: 88 First of all, replace all your getch() with cin.get().
Your class animal_game has 2 members function, but they're not implemented, so this wont compile because if you say you'll return a value... |
Forum: C++ 18 Hours Ago |
| Replies: 3 Views: 89 And there seems to missing a small detail called int main() :icon_wink: |
Forum: C++ 19 Hours Ago |
| Replies: 7 Views: 147 An education in programming helps. But most of all: *a lot* of practice. The best thing is to have a job in the C++-field, because you can pick up a lot form co-workers and you'll constantly get new... |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 106 |
Forum: C++ 1 Day Ago |
| Replies: 3 Views: 106 try this:
#include <iostream>
#include <string>
int main ()
{
std::string test = "test 1-2-3";
std::cout << test; |
Forum: C++ 1 Day Ago |
| Replies: 8 Views: 164 Well, err, yeah... I guess my brain misfired, sorry 'bout that one. :icon_sad: |
Forum: C++ 2 Days Ago |
| Replies: 8 Views: 164 You didn't click the link I gave you right? |
Forum: C++ 2 Days Ago |
| Replies: 3 Views: 155 What do you mean "most likely ", you didn't try to compile the code yet? What exactly is your question? |
Forum: C++ 2 Days Ago |
| Replies: 5 Views: 117 OpenCV (http://sourceforge.net/projects/opencv/) |
Forum: C++ 2 Days Ago |
| Replies: 8 Views: 164 Read this (http://eternallyconfuzzled.com/tuts/datastructures/jsw_tut_avl.aspx) |
Forum: C++ 2 Days Ago |
| Replies: 5 Views: 160 Double thread. (http://www.daniweb.com/forums/thread242895.html) Closed. |
Forum: C++ 3 Days Ago |
| Replies: 10 Views: 269 I think you misunderstood me. Change all the getline(cin.ignore(), new_modify); back to getline(cin, new_modify);
What I meant was this:
int i =0 ;
string something = "";
cin >> i;... |
Forum: C++ 3 Days Ago |
| Replies: 10 Views: 269 Put a cin.ignore() after every cin >> ......
The reason (http://www.daniweb.com/forums/thread90228.html)you don't get a change to input anything is because "cin >>" leaves a '\n' on the input... |
Forum: C++ 3 Days Ago |
| Replies: 2 Views: 180 Thank you for the follow up. You could post your code here, I'm sure people will have a look at it. Perhaps someone can give you some tips on 'streamlining' your code :) |
Forum: C++ 3 Days Ago |
| Replies: 10 Views: 269 I suggest you use getline() to get input from the user. Getline takes in input until a newline (enter) is detected. This is handy in you case, because you need 2 words (first and last name).
To... |
Forum: C++ 4 Days Ago |
| Replies: 3 Views: 166 All the thing mentioned by you could speed up your program. But the main question is: Why are you loading 100 mb of data in your memory? This might be a good time to review your algorithm! |
Forum: C++ 4 Days Ago |
| Replies: 7 Views: 180 So what have you done so far? |
Forum: C++ 4 Days Ago |
| Replies: 9 Views: 265 Vectors are indeed the way to go. But not with fixed sizes as recommended to you by 'other people'. Here's an example of what I mean:
#include <vector>
#include <iostream>
int main(){
... |
Forum: C++ 5 Days Ago |
| Replies: 5 Views: 162 So you haven't got a clue how to solve the problem, but you refuse to drop the course because you think you'll get some free points by cheating your way through it? I've heard enough, thread closed.... |
Forum: C++ 5 Days Ago |
| Replies: 3 Views: 184 Moved & closed due to double thread. Discussion continued here (http://www.daniweb.com/forums/post1061701.html#post1061701) |
Forum: C++ 6 Days Ago |
| Replies: 7 Views: 213 We (try to) help everyone here from beginner to pro. So stick around ;) We all started out at the bottom. |
Forum: C++ 6 Days Ago |
| Replies: 7 Views: 213 this is wrong: mi = KM_MI * km;
"KM_MI" == km per mile. So if you already have km and want to go to miles, you should divide by this number, not multiply:
mi = km / KM_MI ;
Same error is in... |
Forum: C++ 7 Days Ago |
| Replies: 7 Views: 263 Then you're wrong. Looks like the 'perfect' function for a 2d-array. |
Forum: C++ 7 Days Ago |
| Replies: 2 Views: 146 str[80] just means: an array of 80-chars. They just chose 'more then enough' characters. 100 would also be fine, or 30.
If you're serious about learning C++, then drop the characterarray as soon... |
Forum: C++ 9 Days Ago |
| Replies: 7 Views: 389 If you have indented (http://en.wikipedia.org/wiki/Indent_style)your original code and then paste it here and use code-tags (http://www.daniweb.com/forums/misc-explaincode.html).\, your code will... |
Forum: C++ 10 Days Ago |
| Replies: 7 Views: 389 With a code-beautifier or by hand. You could start with removing all the extra white-lines in the code. What IDE are you using? If you're using Visual, then simply press, ctrl-a, ctrl-k, ctrl-f (in... |
Forum: C++ 10 Days Ago |
| Replies: 11 Views: 8,979 @Neithan:
First: What Narue said.
Second: A meaningless bump like this (begging for code) will be deleted by me. By replying to this bump, you give me 2 choices:
1. Leave them both (as in this... |
Forum: C++ 10 Days Ago |
| Replies: 5 Views: 203 |
Forum: C++ 11 Days Ago |
| Replies: 9 Views: 5,508 For some reason this thread is attracting people who like to post the exact same message over and over again, so I'm closing it.
People who read this thread in the future: Please upgrade to a... |
Forum: C++ 12 Days Ago |
| Replies: 2 Views: 366 Selection-sort is not the same thing as insertion-sort ;) |
Forum: C++ 14 Days Ago |
| Replies: 6 Views: 459 This may very well be the best post I have ever read on Daniweb. :icon_mrgreen: |
Forum: C++ 14 Days Ago |
| Replies: 8 Views: 222 Because it makes the code easier to read? All major IDE's have syntax-highlighting. What IDE/compiler are you using? |
Forum: C++ 14 Days Ago |
| Replies: 8 Views: 222 It's magic!
Example:
int number = 0;
cout << "hello" << number << '\n';
now the exact same text but in tags:
int number = 0; |
Forum: C++ 14 Days Ago |
| Replies: 8 Views: 222 For the entire block of code indeed. |
Forum: C++ 14 Days Ago |
| Replies: 13 Views: 15,671 Read post no. 11.
Thread closed due to multiple useless resurrections in the last 3 years. |
Forum: C++ 14 Days Ago |
| Replies: 2 Views: 194 So what exactly is your question? |
Forum: C++ 14 Days Ago |
| Replies: 3 Views: 236 strlen and char-arrays in C++? :icon_eek:
Why not use the functions provided to us:
#include <iostream>
#include <string>
#include <algorithm>
int main() |