Showing results 1 to 40 of 109
Search took 0.01 seconds.
Posts Made By: jencas
Forum: C++ 1 Day Ago
Replies: 3
Views: 64
Posted By jencas
Re: Linked Lists using struct

struct rekord
{
char key[10];
int nr;
rekord *next;
};
Forum: C++ 3 Days Ago
Replies: 2
Views: 164
Posted By jencas
Re: Insertion sort in c++

What's your problem?
Forum: C++ 23 Days Ago
Replies: 6
Views: 255
Posted By jencas
Re: How do I make vectors of an already vectorized thing?

/*-Student Class High-*/
class Student : public School{
};


Inheritance means an "is a" relationship, but you have a "has a" relationship. Try to understand the basics of OO before you begin to...
Forum: C++ 23 Days Ago
Replies: 4
Views: 161
Posted By jencas
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
Posted By jencas
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
Posted By jencas
Re: About overloading

Error message???
Forum: C++ 34 Days Ago
Replies: 5
Views: 143
Posted By jencas
Re: arrays! a little help!

You need int a[4] and int b[4] for every month, something like:

int a[12][4];
int b[12][4];
Forum: C++ 34 Days Ago
Replies: 9
Views: 236
Posted By jencas
Re: Deleting spaces in a string

Try:


for (int i = 0; i < ephrase.length(); i++)
{
if (ephrase[i] == ' ')
continue;

for (int h = 0; h < 36; h++)
{
Forum: C++ 34 Days Ago
Replies: 9
Views: 236
Posted By jencas
Re: Deleting spaces in a string

if (ephrase[i] == ' ')
{
ephrase[i]++;
}



Do you really really want to increment the value of the char at ephrase[i]?
Forum: C++ 34 Days Ago
Replies: 9
Views: 236
Posted By jencas
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
Posted By jencas
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
Posted By jencas
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
Posted By jencas
Re: Help with connect 4 game

What the heck is X?

Replace

if (turn%2==0)
player=O;
else
player=X;
Forum: C++ Nov 24th, 2008
Replies: 7
Views: 337
Posted By jencas
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
Posted By jencas
Re: basic struct declaration problem

declare in .h:

struct entry_t
{
int key;
};

define in .cpp:

entry_t entry[TABLE_SIZE];
Forum: C++ Nov 3rd, 2008
Replies: 1
Views: 259
Posted By jencas
Re: Linked List of Array

Use templates.
Forum: C++ Oct 23rd, 2008
Replies: 7
Views: 383
Posted By jencas
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
Posted By jencas
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
Posted By jencas
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
Posted By jencas
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
Posted By jencas
Forum: C++ Oct 16th, 2008
Replies: 12
Views: 431
Posted By jencas
Re: where to download??

a small enhancement:

If (YouHaveMoney)
{
UseVisualStudio
}
else
{
UseVisualStudioExpress;
}
Forum: C++ Oct 16th, 2008
Replies: 12
Views: 431
Posted By jencas
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
Posted By jencas
Forum: C++ Oct 16th, 2008
Replies: 18
Views: 867
Posted By jencas
Re: Inserting a number to an array

This is definitely a job for std::vector!
Forum: C++ Oct 14th, 2008
Replies: 4
Views: 225
Posted By jencas
Re: struct

getFirstMatch(google("cpp reference struct"));
Forum: C++ Oct 14th, 2008
Replies: 4
Views: 380
Posted By jencas
Re: reversing the words in a char array

...and preferably use strlen() to determine the length of a C-string!!
Forum: C++ Oct 14th, 2008
Replies: 1
Views: 247
Posted By jencas
Re: FTP Connection

google("c++ ftp source code");
Forum: C++ Oct 9th, 2008
Replies: 1
Views: 163
Posted By jencas
Re: Who can explain this to me??

Have a look at the source code of std::map and search for 'value_type'. Then you'll understand. Hopefully.
Forum: C++ Oct 9th, 2008
Replies: 5
Views: 346
Posted By jencas
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
Posted By jencas
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
Posted By jencas
Re: Secret Message in Bitmap

google "steganography"
Forum: C++ Oct 7th, 2008
Replies: 2
Views: 180
Posted By jencas
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
Posted By jencas
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
Posted By jencas
Re: Please Help me to Understand the callback functions using this pgm.

You have a SONY CD-Player and if you click the button it plays. Where is the problem???
Forum: C++ Sep 25th, 2008
Replies: 4
Views: 477
Posted By jencas
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
Posted By jencas
Re: help me finding the bug while reading boot sector

Found it. Device name is case insensitive. So just ignore the last part of my answer above.
Forum: C++ Sep 25th, 2008
Replies: 35
Views: 2,789
Posted By jencas
Re: The Fastest way to read a .txt File

Yes, but loading the whole file in a single step makes it very fast. I agree, for files of a several 100 MB or more I wouldn't recommend this method, too.
Forum: C++ Sep 25th, 2008
Replies: 3
Views: 353
Posted By jencas
Re: help me finding the bug while reading boot sector

You need administrative rights to do this under NT operating systems. And doesn't the device name has to be all lower case (can't remember...)??

#define PHYSICAL_DRIVE "\\\\.\\physicaldrive0"
Forum: C++ Sep 25th, 2008
Replies: 35
Views: 2,789
Posted By jencas
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...
Showing results 1 to 40 of 109

 
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:34 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC