473,883 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wchar_t

Hello,

does anyone know which layer is responsible for defining the size of
wchar_t?

Naturally enough, it's not defined in the language. I looked in the
SystemV processor supplement and the Itanium C++ ABI which are
authorative for my platform, but there is no mentioning of this.

The manual of the compiler I'm using, gcc, doesn't tell me either.

Does anyone know more?

Cheers,

Jens
Sep 27 '06
12 14664
"Gavin Deane" <de*********@ho tmail.comwrites :
So, just like any other integral type, if you want to know the actual
size in your implementation [...]
I quote from my last posting:
I think I was quite explicit in my posting that I'm not wondering
about how big it is, but where it's defined.
You just told me that's it's not defined in the language:
>, you need to consult your implementation.
sizeof L'x' is one easy way to do that. The answer may be different for
diifferent implementations .
something which I have already stated in my first posting!

Regards,

Jens
Sep 29 '06 #11
"Jens Theisen" <jt***@arcor.de wrote in message
news:87******** ****@arcor.de.. .
"P.J. Plauger" <pj*@dinkumware .comwrites:
Naturally enough, it's not defined in the language.

Naturally enough, it is. L'x' has type wchar_t, so sizeof L'x'
tells you the size of wchar_t.

I think I was quite explicit in my posting that I'm not wondering
about how big it is, but where it's defined.
What you said was:

: does anyone know which layer is responsible for defining the size of
: wchar_t?
:
: Naturally enough, it's not defined in the language.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
Sep 30 '06 #12

Jens Theisen wrote:
"Gavin Deane" <de*********@ho tmail.comwrites :
So, just like any other integral type, if you want to know the actual
size in your implementation [...]

I quote from my last posting:
I think I was quite explicit in my posting that I'm not wondering
about how big it is, but where it's defined.

You just told me that's it's not defined in the language:
, you need to consult your implementation.
sizeof L'x' is one easy way to do that. The answer may be different for
diifferent implementations .

something which I have already stated in my first posting!
So you already knew that the language does not specify the exact number
of bits or bytes or octets or whatever in a wchar_t. And you already
know that this implies that the size of wchar_t might be different in
different implementations of the language. Since the suggestion that
one way of finding out the size of wchar_t in your implementation is to
do sizeof L'x' didn't seem to satisfy you, you presumably aren't asking
"How do I find out the size of wchar_t in my implementation? "

You originally asked "does anyone know which layer is responsible for
defining the size of
wchar_t?". I don't know what that question means. What do you mean by
"layer"? The only sensible question I can think of in this context is,
"How do I find out the size of wchar_t in my implementation? ". So when
I read your post, I couldn't understand your question as you wrote it,
but I assumed you were asking "How do I find out the size of wchar_t in
my implementation? " because that is the only question I could think
that you might be trying to ask.

Is that your question? Or is it something else? Or has it been answered
already?

Gavin Deane

Sep 30 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2990
by: Julius Mong | last post by:
Hi all, I'm doing this: // Test char code wchar_t lookup = {0x8364, 0x5543, 0x3432, 0xabcd, 0xef01}; for (int x=0; x<5; x++) { wchar_t * string = (wchar_t*) malloc(sizeof(wchar_t)); string = (wchar_t*)lookup; string = '\0'; CComBSTR bstrTest = SysAllocString(string); }
1
3548
by: Mark Fancy | last post by:
I have a project that I'm trying to get to compile. I need to have the /Tc:wchar_t compile switch in order to use some libraries. I have included the following header files: #include <mapix.h> #include <mapiutil.h> #include <imessage.h> #include <mapitags.h> When I try to compile my project I get the following error:
23
8211
by: Steven T. Hatton | last post by:
This is one of the first obstacles I encountered when getting started with C++. I found that everybody had their own idea of what a string is. There was std::string, QString, xercesc::XMLString, etc. There are also char, wchar_t, QChar, XMLCh, etc., for character representation. Coming from Java where a String is a String is a String, that was quite a shock. Well, I'm back to looking at this, and it still isn't pretty. I've found...
1
2331
by: jjf | last post by:
Do Standard C's wide characters and wide strings require absolutely that each character be stored in a single wchar_t, or can characters be "multi-wchar_t" in the same way that they can be multibyte? Is it a requirement that the number of wchar_t's in a string is the same as the number of characters in the string (give or take the terminal null character)? The particular case I'm puzzling over is whether or not it is conforming for an...
8
23920
by: Rui Maciel | last post by:
I've just started learning how to use the wchar_t data type as the basis for Unicode strings and unfortunately I'm having quite a bit of problems, both in the C front and the Unicode front. In this case,it seems that the wprintf function isn't able to print a string beyond the first character. I don't have a clue why this is happening. Here is the test code: <code> #include <stdlib.h>
3
6418
by: john | last post by:
As far as I know there is only the type wchar_t. However my compiler compiles both "signed wchar_t" and "unsigned wchar_t". Are there both signed and unsigned wchar_t types?
16
4374
by: Michael Brennan | last post by:
I guess this question only applies to programming applications for UNIX, Windows and similiar. If one develops something for an embedded system I can understand that wchar_t would be unnecessary. I wonder if there is any point in using char over wchar_t? I don't see much code using wchar_t when reading other people's code (but then I haven't really looked much) or when following this newsgroup. To me it sounds reasonable to make sure...
5
17055
by: yakir22 | last post by:
Hello experts, I am dealing now in porting our server from windows to linux. our client is running only on windows machine. to avoid the wchar_t size problem ( in windows its 2 bytes and linux is 4 bytes ) we defined #ifdef WIN32 #define t_wchar_t wchar_t #else // LINUX #define t_wchar_t short
5
4753
by: Samant.Trupti | last post by:
Hi, There is one thing I am cofused about.... If I have a declareation say char str; Now if I want to change it to wchar so do I have to change it like .... wchar_t str; or double the size? like
0
9933
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9786
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10836
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9568
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5794
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5982
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4211
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.