Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3427996
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:54:20+00:00 2026-05-18T06:54:20+00:00

I am using windows 7 64 bit with MSVC2005 and QT (but I doubt

  • 0

I am using windows 7 64 bit with MSVC2005 and QT (but I doubt QT is causing the problem since this is an issue with the fundamental data type char.

So when I try to compare two char’s like so

char A=0xAA;

if(A==0xAA)
 printf("Success");
else
 printf("Fail");

lo and behold it fails! but when I do this

char A=0xAA;
char B=0xAA;

if(A==B)
 printf("Success");
else
 printf("Fail");

I get success! Actually when I thought about it… hey I’m working on a 64 bit processor.. even though char’s are supposed to be treated as 1 byte. It’s probablly stored as 4 bytes.
So

char A=0xAA;

if(A==0xFFFFFFAA)
 printf("Success");
else
 printf("Fail");

Now I get success!!!

But WTF! Is this standard behavior!! If the damn thing is defined as a char, shouldn’t the compiler know what to do with it? Further tests show that the extra bytes are only stored as one’s if the most significant bit of the char is a 1. So 0x07 and lower is stored as 0x00000007. WTF.

Actually I seemed to have answered all my questions… except who to call to get this bug fixed. Is this even a bug? You can use MSVC2005 on 64 bit operating systems right or am I being an idiot. I guess I should get qt creator to use MSVC2010.. damn it. There goes my 2 hours.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:54:21+00:00Added an answer on May 18, 2026 at 6:54 am

    You are comparing a (signed) char with the value -86 (256-0xAA) to an integer with the value 170 (0xAA).

    The same will happen on a 32-bit system, and an 8-bit system, for that matter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My pc is using Windows 7 64 bit. But the server where my jsp
I am using Windows 2008 r2 64 bit system. While testing our script ,we
I have been learning Python2.7 for a little bit now. I'm using Windows 7
I’m using a Windows 7 Enterprise edition 64 bit, the firewall means certain update
I'm using Qt 4.7.0 (32 bit) on Windows(mingw32). The app is crashing when setVisible(),setDisabled(),hide()
It seems that using Critical Sections quite a bit in Vista/Windows Server 2008 leads
I'm running Windows 7 Ultimate (64 bit) using Visual Studio 2010 RC. I recently
I have a 32-bit application that must run on a Windows x64 server using
I am using: Rails 2.3.5 Ruby 1.8.7 Windows 7 Home basic 64-bit I'm trying
.NET 4.0, Windows 7, VS 2010: Trying to install 64-bit service using the Setup

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.