3 Replies - 18309 Views - Last Post: 26 November 2008 - 06:45 AM Rate Topic: -----

#1 C+Bugude  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-November 08

Converting Uint8 to Char in C++

Posted 26 November 2008 - 05:28 AM

Hi,
Can any one help me in covertin the ascii Uint8 value to char,
i tried with for loop.
but no use.
Is This A Good Question/Topic? 0
  • +

Replies To: Converting Uint8 to Char in C++

#2 janotte  Icon User is offline

  • code > sword
  • member icon

Reputation: 990
  • View blog
  • Posts: 5,141
  • Joined: 28-September 06

Re: Converting Uint8 to Char in C++

Posted 26 November 2008 - 05:36 AM

Please note posting rule 2: You must show your code before receiving help.

Please show us what you have done so far.

This post has been edited by janotte: 26 November 2008 - 05:37 AM

Was This Post Helpful? 0
  • +
  • -

#3 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,559
  • Joined: 25-January 07

Re: Converting Uint8 to Char in C++

Posted 26 November 2008 - 05:50 AM

Just typecast this int value to char and print or assign it to char variable and print that variable. That can solve your problem.
Was This Post Helpful? 0
  • +
  • -

#4 Delta_Echo  Icon User is offline

  • D.I.C Addict

Reputation: 5
  • View blog
  • Posts: 722
  • Joined: 24-October 07

Re: Converting Uint8 to Char in C++

Posted 26 November 2008 - 06:45 AM

int a = 127;
cout << (char)a << endl;



Typcasting is fun :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1