Forum: C++ 10 Days Ago |
| Replies: 5 Views: 266 It's hard to track your code because it has no formatting, and no conventional naming scheme is used. Here's an example:
int main
{
double end_point[2] = {0.0},
epsilon =... |
Forum: C++ Sep 24th, 2009 |
| Replies: 3 Views: 287 int main() is missing return(0);
Which is what would terminate you program, as well.
btw, You don't need system("pause");
cout <<"Slam on your keyboard."; cin.get(); |
Forum: C++ Sep 13th, 2009 |
| Replies: 2 Views: 655 Plain Jane C, unless you want to waste your time rolling your own port. |
Forum: C++ Sep 12th, 2009 |
| Replies: 8 Views: 519 uhhhh.... Do you even know C++? No one can help you if you don't even know the basics. |
Forum: C++ Sep 11th, 2009 |
| Replies: 10 Views: 2,175 It's <iostream> not <iostream.h>, avoid <conio.h>, and you probably won't need <cmath>.
Now let me freak your mind: You're using Turbo C++, or tutorials for it? Right?
There's a simple bit... |
Forum: C++ Aug 6th, 2009 |
| Replies: 14 Views: 510 Because they require a const char* not a std::string. Try string.c_str() (http://www.cplusplus.com/reference/string/string/c_str/)
And remove that system() call at the end. |
Forum: C++ Aug 6th, 2009 |
| Replies: 4 Views: 304 Why not just a vector of vectors? |
Forum: C++ Aug 6th, 2009 |
| Replies: 6 Views: 313 You don't need to cast your call.
You should be extremely wary of ever using system(), in fact it should just be avoided. Else risk being ridiculed or angry e-mails when something goes wrong... |
Forum: C++ Aug 5th, 2009 |
| Replies: 10 Views: 468 Why not just str1 = str2; |
Forum: C++ Aug 5th, 2009 |
| Replies: 10 Views: 468 string temp;
...
getline(infile, temp);
pic_links.push_back(temp);
...
Most of your code is unnecessary, since most of it is already provided. |
Forum: C++ Aug 5th, 2009 |
| Replies: 10 Views: 468 Try private: vector<string> varible_name;
Vector is dynamic and you can kill off unused strings, unlike a constant array.
Oh yeah, std::string is different from a C-string(char... |
Forum: C++ Aug 4th, 2009 |
| Replies: 6 Views: 313 Assuming you're on Windows: ShellExecute() (http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx) |
Forum: C++ Aug 4th, 2009 |
| Replies: 7 Views: 473 Audiere (http://audiere.sourceforge.net/)
And if you can't use that, you may want to take a class or two on programming... |
Forum: C++ Aug 1st, 2009 |
| Replies: 2 Views: 245 There is this for_each() (http://www.cplusplus.com/reference/algorithm/for_each/), but I think you're confused with foreach from another language like C#, PHP, or something.
Wrong section perhaps? |
Forum: C++ Aug 1st, 2009 |
| Replies: 2 Views: 267 Have you tried <algorithm>'s remove (http://www.cppreference.com/wiki/stl/algorithm/remove)?
Something like:
string.erase(remove(string.begin(), string.end(), "-."), string.end());
By the way,... |
Forum: C++ Jul 31st, 2009 |
| Replies: 5 Views: 548 Or don't use exit() at all, unless there's some sort of critical lockup that keeps your program from going any further.
Generally good error handling will lead you to the end of main, with just a... |
Forum: C++ Jul 31st, 2009 |
| Replies: 11 Views: 489 Local colleges usually have classes you can enroll in. You can usually even use it as credit, if you go to college, latter on.
Truthfully, you can learn C languages at home easy enough. |
Forum: C++ Jul 20th, 2009 |
| Replies: 5 Views: 933 necrolin it's just:
srand(time(NULL));/*only once*/
int var = rand()%max_requested_value; |
Forum: C++ Jul 18th, 2009 |
| Replies: 6 Views: 552 There seems to be a bit pattern with prime numbers, see if you can find it.
http://www.ascii.cl/conversion.htm
http://en.wikipedia.org/wiki/List_of_prime_numbers |
Forum: C++ Jul 12th, 2009 |
| Replies: 7 Views: 751 And those errors would be? |
Forum: C++ Jul 12th, 2009 |
| Replies: 7 Views: 751 Why are you using Races as a pointer?
You should format your code, it's hard to read. |
Forum: C++ Jul 12th, 2009 |
| Replies: 11 Views: 664 With an uppercase on window compilers.
If you're going to send him on the windows.h route, perhaps this might be of relevance: http://msdn.microsoft.com/en-us/library/ms646293(VS.85).aspx |
Forum: C++ Jul 11th, 2009 |
| Replies: 4 Views: 1,317 Interesting. The only way I remember using bitset is in a template function, with bitset passed the value in its initializer.
By the way, you can use numeric_limits<T>::digits instead of sizeof() |
Forum: C++ Jul 11th, 2009 |
| Replies: 4 Views: 1,317 Wait. bitset has an OR operator? Didn't realize that. |
Forum: C++ Jul 8th, 2009 |
| Replies: 5 Views: 339 Write an assembler, allocate some space and run the output as a function. |
Forum: C++ Jul 7th, 2009 |
| Replies: 18 Views: 723 Debugging, since it usually prints right when you tell it too, while your regular debugger is flipping out. |
Forum: C++ Jul 5th, 2009 |
| Replies: 8 Views: 233 The book is wrong because if you use 5/9*(x) = (x*9)/5
Try the simpler constant version AD posted. |
Forum: C++ Jul 5th, 2009 |
| Replies: 8 Views: 233 You should add another parentheses (5/9)*(°-32).
Why are you 'fixing' and using setprecisioin() if you're using integers?
Why not use float or double instead of int?
edit: nvm AD already posted... |
Forum: C++ Jul 5th, 2009 |
| Replies: 8 Views: 368 http://www.cplusplus.com/doc/tutorial/dynamic/
type *var = new type[size];
if(!var) return(false); /*or somesort of error handling*/
delete [] var; |
Forum: C++ Jul 3rd, 2009 |
| Replies: 8 Views: 449 Brew one yourself. Certainly not for beginners. |
Forum: C++ Jul 3rd, 2009 |
| Replies: 2 Views: 240 I assume you know how to do basic file i/o?
http://www.cplusplus.com/reference/iostream/ofstream/
http://www.cplusplus.com/reference/iostream/ifstream/
Write/read how many objects you have, then... |
Forum: C++ Jul 1st, 2009 |
| Replies: 8 Views: 1,959 |
Forum: C++ Jul 1st, 2009 |
| Replies: 2 Views: 615 With sstream-hex you have to add the zero.
Something like:
vector<string> test; //or array, doesn't matter
...
if(test[i].size() < 2)
test[i].insert(0, "0"); |
Forum: C++ Jul 1st, 2009 |
| Replies: 5 Views: 266 Get a pointer/array then start writing outside bounds.
Get to it. |
Forum: C++ Jun 29th, 2009 |
| Replies: 8 Views: 393 All the tobasco sauce I just drank. I can't feel my tongue.
Does that answer your question? |
Forum: C++ Jun 29th, 2009 |
| Replies: 2 Views: 315 Reallocate pointer1 to size of itself plus pointer2, then memmove() p2 to the end of p1. |
Forum: C++ Jun 29th, 2009 |
| Replies: 8 Views: 393 Code::Blocks with MinGW is my choice.
.NET is like asking someone to commit suicide. It's a bloated piece of crap. |
Forum: C++ Jun 28th, 2009 |
| Replies: 4 Views: 397 Have everything compressed before hand.
And what's your code, show us you're not doing something idiotic. |
Forum: C++ Jun 27th, 2009 |
| Replies: 13 Views: 574 http://www.cplusplus.com/doc/tutorial/dynamic/ |
Forum: C++ Jun 27th, 2009 |
| Replies: 1 Views: 347 Since your using Windows: http://msdn.microsoft.com/en-us/library/ms646268(VS.85).aspx |