Search Results

Showing results 1 to 40 of 401
Search took 0.03 seconds.
Search: Posts Made By: MosaicFuneral ; Forum: C++ and child forums
Forum: C++ 10 Days Ago
Replies: 5
Views: 266
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Plain Jane C, unless you want to waste your time rolling your own port.
Forum: C++ Sep 12th, 2009
Replies: 8
Views: 519
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Why not just a vector of vectors?
Forum: C++ Aug 6th, 2009
Replies: 6
Views: 313
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Why not just str1 = str2;
Forum: C++ Aug 5th, 2009
Replies: 10
Views: 468
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Code Snippet: Rolling Die!
Views: 933
Posted By MosaicFuneral
necrolin it's just:
srand(time(NULL));/*only once*/
int var = rand()%max_requested_value;
Forum: C++ Jul 18th, 2009
Replies: 6
Views: 552
Posted By MosaicFuneral
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
Posted By MosaicFuneral
And those errors would be?
Forum: C++ Jul 12th, 2009
Replies: 7
Views: 751
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Wait. bitset has an OR operator? Didn't realize that.
Forum: C++ Jul 8th, 2009
Replies: 5
Views: 339
Posted By MosaicFuneral
Write an assembler, allocate some space and run the output as a function.
Forum: C++ Jul 7th, 2009
Replies: 18
Views: 723
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Brew one yourself. Certainly not for beginners.
Forum: C++ Jul 3rd, 2009
Replies: 2
Views: 240
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Forum: C++ Jul 1st, 2009
Replies: 2
Views: 615
Posted By MosaicFuneral
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
Posted By MosaicFuneral
Get a pointer/array then start writing outside bounds.

Get to it.
Forum: C++ Jun 29th, 2009
Replies: 8
Views: 393
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
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
Posted By MosaicFuneral
http://www.cplusplus.com/doc/tutorial/dynamic/
Forum: C++ Jun 27th, 2009
Replies: 1
Views: 347
Posted By MosaicFuneral
Since your using Windows: http://msdn.microsoft.com/en-us/library/ms646268(VS.85).aspx
Showing results 1 to 40 of 401

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC