Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Search Forums
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Showing results 1 to 25 of 49
Search took 0.01 seconds.
Search: Posts Made By: Marc Gregoire
Forum: BOOK: Professional C++, 2nd Edition June 4th, 2016, 10:34 AM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
Sure, MFC makes it easy to quickly design basic...

Sure, MFC makes it easy to quickly design basic dialogs.
The MFC-way of designing dialogs is of course less flexible than using a technology such as WPF (C#).
Forum: BOOK: Professional C++, 2nd Edition June 4th, 2016, 09:35 AM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
If you write them with operator <<, then yes,...

If you write them with operator <<, then yes, they are converted to text.
Forum: BOOK: Professional C++, 2nd Edition June 1st, 2016, 01:40 PM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
Just try to remove the quoted() then. In that...

Just try to remove the quoted() then.
In that case of course, the name cannot contain spaces.
If you do want to support spaces, then you'll have to do some more parsing yourself, for example by...
Forum: BOOK: Professional C++, 2nd Edition May 19th, 2016, 02:00 PM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
One option is to write them as follows: outFile...

One option is to write them as follows:
outFile << quoted(getDescription()) << ' ' << getSize() << ' ' << boolalpha << getHasChocolateChips() << '\n';
Note that I'm using the quoted() manipulator...
Forum: BOOK: Professional C++, 2nd Edition May 16th, 2016, 04:08 AM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
You'll have to format the data in such a way that...

You'll have to format the data in such a way that you can read it back.
If you look at the createMuffin() method, you see that it is able to parse/read muffins formatted as follows:
Muffin_Name...
Forum: BOOK: Professional C++, 2nd Edition May 15th, 2016, 07:01 AM
Replies: 12
Views: 10,127
Posted By Marc Gregoire
On page 559, there is a section called "Input and...

On page 559, there is a section called "Input and Output with Objects" that explains how to add support for operator<< and >> to your own objects.
With these you can then stream your objects to for...
Forum: BOOK: Professional C++, 2nd Edition April 30th, 2016, 04:27 AM
Replies: 8
Views: 1,057
Posted By Marc Gregoire
You seem to be missing a main() function. For...

You seem to be missing a main() function. For example:
int main() { }
Forum: BOOK: Professional C++, 2nd Edition April 30th, 2016, 04:26 AM
Replies: 4
Views: 906
Posted By Marc Gregoire
br is referring to a base instance, so *it is* a...

br is referring to a base instance, so *it is* a base instance, it is *not* a derived instance, so you cannot cast it to derived.
You can only downcast if the instance you have *really is an*...
Forum: BOOK: Professional C++, 2nd Edition April 26th, 2016, 02:04 PM
Replies: 8
Views: 1,057
Posted By Marc Gregoire
You still need to implement your Super(int i)...

You still need to implement your Super(int i) constructor.
For example as follows (just an empty implementation):
Super::Super(int i) { }
Forum: BOOK: Professional C++, 2nd Edition April 26th, 2016, 02:02 PM
Replies: 9
Views: 892
Posted By Marc Gregoire
Glad you found the solution. Well done :)

Glad you found the solution.
Well done :)
Forum: BOOK: Professional C++, 2nd Edition April 26th, 2016, 01:38 PM
Replies: 4
Views: 906
Posted By Marc Gregoire
It depends on what br really is. For example,...

It depends on what br really is.
For example, if br is really a Base reference to an instance of Derived, then the dynamic_cast will work. However, if br is really a Base reference to an instance of...
Forum: BOOK: Professional C++, 2nd Edition April 21st, 2016, 01:26 PM
Replies: 9
Views: 892
Posted By Marc Gregoire
That is correct. That way you learn more. I just...

That is correct. That way you learn more. I just wanted to make sure you knew that you can download the source code for this book and look at it.

Forward declarations are briefly discussed and...
Forum: BOOK: Professional C++, 2nd Edition April 21st, 2016, 01:23 PM
Replies: 8
Views: 1,057
Posted By Marc Gregoire
What the text is saying is that all constructors...

What the text is saying is that all constructors of Sub *must* explicitly call the Super constructor with a parameter. For example:
Sub::Sub() : Super(7)
{
// Do Sub's other initialization...
Forum: BOOK: Professional C++, 2nd Edition April 20th, 2016, 03:46 PM
Replies: 2
Views: 663
Posted By Marc Gregoire
That's just for this example. In my spreadsheet...

That's just for this example.
In my spreadsheet example, I want to make a difference between having no value and having an empty string as value, hence the "#NOVALUE" sentinel.
Forum: BOOK: Professional C++, 2nd Edition April 20th, 2016, 03:43 PM
Replies: 2
Views: 700
Posted By Marc Gregoire
A constructor in C++ cannot be virtual and so...

A constructor in C++ cannot be virtual and so also not pure virtual.
Since in this example, the constructor is not actually doing anything useful, you might as well remove it in this case.
However,...
Forum: BOOK: Professional C++, 2nd Edition April 20th, 2016, 03:39 PM
Replies: 8
Views: 1,057
Posted By Marc Gregoire
First, the code you are posting is not the same...

First, the code you are posting is not the same as in the book.
You have specified a default value for the parameter in the Super constructor and thus your Super class has in fact a default...
Forum: BOOK: Professional C++, 2nd Edition April 20th, 2016, 03:36 PM
Replies: 9
Views: 892
Posted By Marc Gregoire
Then you can probably use a forward declaration...

Then you can probably use a forward declaration of Spreadsheet in SpreadSheetCell.h.

It's hard to follow what exactly you are trying to do.
Why don't you download the source code for the book...
Forum: BOOK: Professional C++, 2nd Edition April 18th, 2016, 02:13 PM
Replies: 9
Views: 892
Posted By Marc Gregoire
You are missing a: #include "Spreadsheet.h" ...

You are missing a:
#include "Spreadsheet.h"
or a forward declaration of Spreadsheet.
Forum: BOOK: Professional C++, 2nd Edition April 17th, 2016, 01:46 PM
Replies: 9
Views: 892
Posted By Marc Gregoire
In my Visual Studio (2015, Update 1), I don't see...

In my Visual Studio (2015, Update 1), I don't see a red squiggle.
Note however that you have a small typo in your line. The correct line is:
friend void Spreadsheet::setCellAt(int x, int y, const...
Forum: BOOK: Professional C++, 2nd Edition April 17th, 2016, 01:42 PM
Replies: 2
Views: 799
Posted By Marc Gregoire
In your copy constructor you are missing an...

In your copy constructor you are missing an initialization of mTheApp. Should be:
Spreadsheet::Spreadsheet(const Spreadsheet& src) :
mTheApp(src.mTheApp)
{
mId = sCounter++;
copyFrom(src);...
Forum: BOOK: Professional C++, 2nd Edition April 17th, 2016, 01:36 PM
Replies: 2
Views: 806
Posted By Marc Gregoire
The stdafx.h header is only used when you check...

The stdafx.h header is only used when you check the precompiled header checkbox.
In this header you can put your most used headers that you use, for example, you can put the C++ Standard Library...
Forum: BOOK: Professional C++, 2nd Edition May 16th, 2015, 09:00 AM
Replies: 3
Views: 2,277
Posted By Marc Gregoire
I have started the errata procedure, so it should...

I have started the errata procedure, so it should appear in the online errata in the coming days.
Forum: BOOK: Professional C++, 2nd Edition May 16th, 2015, 04:23 AM
Replies: 3
Views: 2,277
Posted By Marc Gregoire
That was a bug in the second edition and has...

That was a bug in the second edition and has already been fixed in the third edition of the book.
Forum: BOOK: Professional C++, 2nd Edition August 30th, 2014, 05:13 AM
Replies: 2
Views: 2,166
Posted By Marc Gregoire
I don't understand the question. what do you...

I don't understand the question.
what do you mean with "regex_search() criteria"?
If you just mean the regular expression string itself, then sure, you can build up that string at runtime without a...
Forum: BOOK: Professional C++, 2nd Edition August 30th, 2014, 05:12 AM
Replies: 1
Views: 869
Posted By Marc Gregoire
Unfortunately, I cannot help you with Eclipse...

Unfortunately, I cannot help you with Eclipse problems.
Maybe you should post your question on some Eclipse specific forum.
Showing results 1 to 25 of 49

 


All times are GMT -4. The time now is 09:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.