Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Ivor Horton's Beginning Visual C++ 2010
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2010 by Ivor Horton; ISBN: 9780470500880
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2010 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
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2012, 03:55 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unsetting the character set


In Chapter 1 the book says that you need to set the Character Set property to "Not set" or else all win32 projects won't build. Why is that? also I have tried leaving it to unicode and the project built and ran successfully.
  #2 (permalink)  
Old June 15th, 2012, 02:38 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: May 2012
Posts: 66
Thanks: 0
Thanked 4 Times in 4 Posts


I have asked myself the same question. Like you, I also found that the programs I have written so far compile without choosing not set in properties.

I am no expert, and I am using the book for independent study (not any school course). Based on some basic knowledge and research, I can speculate why the author has included the passage you are referring to. Logically the explanation which follows makes good sense to me.

ASCII is single bit code which allows 256 distinct characters. These characters can be produced by a standard keyboard and are more or less English language oriented. Unicode is two bit code which allows 65,536 characters. The extra character set supported by Unicode allows characters used by other languages to be understood by the computer. For example to have a functional understanding of Japanese, you must know about 1000 characters out of the 50,000 total character set. In Chinese you must know about 1000 characters out of the 80,000 total character set.

How does this apply to C++ Win32 projects?
An over simplified explanation here will prevent attempting to deal with concepts which will be discussed in detail later in the book. An essential part of the programming knowledge deals with strings. Strings are a collection of characters. The programming language and compiler join forces to allocate memory to store strings and variables. So far I have presented only fact.

Now I will deal with speculation based on the facts as I understand them. C++ reserves one byte of memory to store characters. (2 raised to the 8th power = 256 characters) Unicode is two bytes in size. (2 raised to the 16th power = 65,536 characters) I am beginning Chapter 3. I don't know how far into the book you are right now. The programs to this point have not been dealing with character or string manipulation.

When we get to character and string manipulation I expect a conflict if properties are set to use Unicode. The compiler will be expecting to use two bytes of memory where C++ is specifying one byte of memory. I would anticipate a compiler error pointing to a problem with memory allocation or a type conflict. Furthermore if properties are chosen as not set, I expect the compiler to allow the C++ code to determine the type and memory allocation.

If you have programmers at work or are in school and have programming instructors available, you may be able to bounce my speculation off them to see if I speculate correctly. I sure would like to know if I connected the dots right on this.


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Same character set output by pressing any key.... anilsaroliya Visual Basic 2005 Basics 1 May 18th, 2007 11:20 AM
character set problem BrendonMelville Java Basics 1 March 15th, 2007 12:16 PM
Character set muthukumar Oracle 0 November 8th, 2005 12:49 AM
How to set DOM character set sonicDace XML 0 May 27th, 2004 08:52 AM
XMLDOM default character set sonicDace XML 0 May 21st, 2004 03:09 PM

All times are GMT -4. The time now is 06:10 AM.

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