C and C++ Programming Resources

C2022 too big for a single character

Discuss simple terms about declaring a simple variable to more complex Visual C++ problems.

Postby angle188 » Mon Jun 05, 2006 1:44 am

Hi,
           I am new to vc++. When I am running the vc++ application I am getting the following error, "C2022-is too big for a single character". How to handle this.
If any one knows the answer for this please reply me. Its very urgent
 
angle
 
 
angle188
 
Posts: 7
Joined: Mon Jun 05, 2006 1:29 am

Postby msaqib » Mon Jun 05, 2006 12:48 pm

Hello and welcome to MYCPLUS forums.
I think you are using escape sequence characters \n, \t in your code. If you can post the code here we might help you better.
C and C++ Programming Tutorials & Source Code
http://mycplus.com
User avatar
msaqib
 
Posts: 74
Joined: Sun Feb 22, 2004 2:38 pm
Location: United Kingdom

Postby angle188 » Tue Jun 06, 2006 12:29 am

H i,
         Thanks for ur response. Here i am posting my code where i am getting the error.
if ( theApp.m_bRTL ) strText = _T('\x202B') + strText;
I think it will help to correct this. Waiting for ur reply.
 
angle
angle188
 
Posts: 7
Joined: Mon Jun 05, 2006 1:29 am

C2022 too big for a single character

Postby guru » Tue Jun 06, 2006 1:41 pm

Hello
 
The problem with your code is that you can not have lengthy unicode string. You have to split it up in parts like..
If you have a string defined as follows, it generates C2026:

Code: Select all
char sz[] ="\imagine a really, really \long string here\";

You could break it up as follows:

Code: Select all
char sz[] ="\imagine a really, really long string here\";

 
So you try it like ....
Code: Select all
if ( theApp.m_bRTL ) strText = _T('\x''20''2B') + strText;

May be it can resolve your problem.
guru
 
Posts: 10
Joined: Fri Feb 11, 2005 1:39 pm

Postby msaqib » Tue Jun 06, 2006 2:08 pm

Hello
You have to use your code in the following way.
if ( theApp.m_bRTL ) strText = _T('\x20') + _T('\x2B') ;
And it will work. Actually you can not have a lengthy unicode string
C and C++ Programming Tutorials & Source Code
http://mycplus.com
User avatar
msaqib
 
Posts: 74
Joined: Sun Feb 22, 2004 2:38 pm
Location: United Kingdom

Postby angle188 » Wed Jun 07, 2006 12:58 am

msaqib wrote:Thanks for ur reply. I wil try that one.
Thanku
angle
angle188
 
Posts: 7
Joined: Mon Jun 05, 2006 1:29 am

Postby johnmarker01 » Tue Aug 26, 2008 8:48 am

            HIIIIIIIII..
WHAT  IS  ALL ABOUT  ..
 COULD U  PLEASE  EXPLAIN ME  ..

JOHN ...


http://www.hookup-tonite.com
johnmarker01
 
Posts: 1
Joined: Tue Aug 26, 2008 8:45 am
Location: United States


Return to Visual C++ Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron