Tuesday, May 1, 2012

Conversion table of numbers from char to int, for problem 7 of chapter 7.

This is just a handy list I will be leaving here. Who knows, I might even have a use for it later.

  • 0 in char is 48 in int
  • 1 in char is 49 in int
  • 2 in char is 50 in int
  • 3 in char is 51 in int
  • 4 in char is 52 in int
  • 5 in char is 53 in int
  • 6 in char is 54 in int
  • 7 in char is 55 in int
  • 8 in char is 56 in int
  • 9 in char is 57 in int

And this is the code I used to get the values:

File contents of SourceCode.cpp
 #include <iostream>  
 using namespace std;  
   
 int main(){  
 char charone = '0';  
 int intone = charone, counter = 1;  
   
 while(counter <= 10){  
 cout << endl;  
 cout << charone << " in char is " << intone << " in int";  
 cout << endl;  
 intone++;  
 charone = intone;  
 counter++;  
 }  
   
 return 0;  
 }  

Hating emacs and debugging...

My hate for emacs got me to find a really nice linux IDE called Eclipse CDT. It was quite heavy to download, but worth it. It's almost like Microsoft Visual Studio Express 2010. So far, debugging in Eclipse has been a breeze. Still better in my humble opinion than emacs.


PS: Thank you hate. You really are useful sometimes.