Forum: C++ 1 Day Ago |
| Replies: 3 Views: 64 |
Forum: C++ 3 Days Ago |
| Replies: 2 Views: 164 |
Forum: C++ 23 Days Ago |
| Replies: 6 Views: 255 |
Forum: C++ 23 Days Ago |
| Replies: 4 Views: 161 Re: Checking pointer for initialization int const len = 10;
float * vertexArray[len] = {0};
initializes all vertexArray[] entries with 0
If you dynamically allocate the array you have to do something like:
float* vertexArray = 0; |
Forum: C++ 24 Days Ago |
| Replies: 3 Views: 206 Re: C++ help :( Try to design your classes by looking at real life. Does the deck really shuffle itself? And who deals the hands, who gets the hands?
I see the following objects:
-card
-deck (set of 52 cards)
-hand... |
Forum: C++ 28 Days Ago |
| Replies: 11 Views: 272 |
Forum: C++ 34 Days Ago |
| Replies: 5 Views: 143 |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 236 |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 236 |
Forum: C++ 34 Days Ago |
| Replies: 9 Views: 236 Re: Deleting spaces in a string referring to the topic and omitting the necessary namespace and #includes:
string str("This is a test");
str.erase(remove_if(str.begin(), str.end(), bind2nd(equal_to<char>(), ' ')), str.end()); |
Forum: C++ 34 Days Ago |
| Replies: 2 Views: 176 Re: file polygon.h ...and familiarize yourself with code tags. That will increase your chance to get an answer enormously. |
Forum: C++ 34 Days Ago |
| Replies: 6 Views: 256 Re: Point*& to Point& In the function call here
'Fleet::Ship::overlaps(const Fleet::Ship*&)'
you are passing a pointer instead of a reference. Dereference the parameter by prefixing it with a '*'.
class A;
void... |
Forum: C++ Nov 28th, 2008 |
| Replies: 8 Views: 278 |
Forum: C++ Nov 24th, 2008 |
| Replies: 7 Views: 337 Re: Linker errors using HWND Read the error message more carefully! There is not a problem with HWND. It seems you have declared but not defined the ctor with the HWND parameter. |
Forum: C++ Nov 10th, 2008 |
| Replies: 6 Views: 277 |
Forum: C++ Nov 3rd, 2008 |
| Replies: 1 Views: 259 |
Forum: C++ Oct 23rd, 2008 |
| Replies: 7 Views: 383 Re: bool function problems! bool isPrime (int)
{
if ( variable > 2 && variable % 2 == 0 )
return true;
else
return false;
}
should better look like |
Forum: C++ Oct 23rd, 2008 |
| Replies: 5 Views: 497 Re: AFXMessageBox AfxMessageBox requires a LPCTSTR but you pass an array of char[30] as a parameter.
char str[30] = "Hello world!";
AfxMessageBox(&x[0]);
works without any problems (in a non-Unicode project). |
Forum: C++ Oct 23rd, 2008 |
| Replies: 2 Views: 197 Re: Internalbuffer for FileSystemWatcher "The FileSystemWatcher class is found in the System.IO namespace". (from the same website as your citation...)
That seems to be .NET, so don't be astonished if your question leaves unanswered here. |
Forum: C++ Oct 23rd, 2008 |
| Replies: 2 Views: 225 Re: Operator -= troubles What about using STL algorithms and avoiding the temporary copy of the vector????
Considering this should result in code like (recite from memory, not tested!!!):
CPlotter &... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 3 Views: 185 |
Forum: C++ Oct 16th, 2008 |
| Replies: 12 Views: 431 Re: where to download?? a small enhancement:
If (YouHaveMoney)
{
UseVisualStudio
}
else
{
UseVisualStudioExpress;
} |
Forum: C++ Oct 16th, 2008 |
| Replies: 12 Views: 431 Re: where to download?? "undefined reference" sounds like if the linker has a problem, not the compiler.
Cut the error message and paste it here. |
Forum: C++ Oct 16th, 2008 |
| Replies: 3 Views: 358 |
Forum: C++ Oct 16th, 2008 |
| Replies: 18 Views: 867 |
Forum: C++ Oct 14th, 2008 |
| Replies: 4 Views: 225 Re: struct getFirstMatch(google("cpp reference struct")); |
Forum: C++ Oct 14th, 2008 |
| Replies: 4 Views: 380 |
Forum: C++ Oct 14th, 2008 |
| Replies: 1 Views: 247 |
Forum: C++ Oct 9th, 2008 |
| Replies: 1 Views: 163 |
Forum: C++ Oct 9th, 2008 |
| Replies: 5 Views: 346 Re: MFC Help : CMenu You can configure something like Strg + Alt + M as keyboard short cut in the resource file but you can't use combinations with two characters |
Forum: C++ Oct 8th, 2008 |
| Replies: 5 Views: 346 Re: MFC Help : CMenu No, the '&' does not make Ctrl+M as your keyboard short cut. I think what you are looking for is an "accelerator key". |
Forum: C++ Oct 7th, 2008 |
| Replies: 2 Views: 262 |
Forum: C++ Oct 7th, 2008 |
| Replies: 2 Views: 180 Re: MFC classes The Standard Edition also contains the MFC. If you are a student, you should take a look at https://downloads.channel8.msdn.com/
If not, try... |
Forum: C++ Oct 6th, 2008 |
| Replies: 3 Views: 219 Re: file to array question Why are you using arrays when std::vectors are more appropriate?
Nevertheless, you need different j's for indexing your b1, b2, b3, b4 sub arrays
and
input_array[i] >> b1[j];
should be something... |
Forum: C++ Sep 26th, 2008 |
| Replies: 4 Views: 272 |
Forum: C++ Sep 25th, 2008 |
| Replies: 4 Views: 477 Re: Complex Class Create a class which holds a single complex number and with an ostream& operator << ( std::ostream &s, const Complex &c). Then implement friend operator +() and friend operator -() for two Complex... |
Forum: C++ Sep 25th, 2008 |
| Replies: 3 Views: 353 |
Forum: C++ Sep 25th, 2008 |
| Replies: 35 Views: 2,789 |
Forum: C++ Sep 25th, 2008 |
| Replies: 3 Views: 353 |
Forum: C++ Sep 25th, 2008 |
| Replies: 35 Views: 2,789 Re: The Fastest way to read a .txt File If you are using MFC you can try something like:
CFile inFile("test.txt", CFile::modeRead);
CArchive archive(&inFile, CArchive::load, inFile.GetLength());
CString line;
while... |