Zo'rlab sikish vido ckachayt 3g

Загрузка плеера...
  • 780
  • 0
  • 0
  • 0

Категория ролика: Как сделать

Теги: zorlab sikish, zorlab, vido, sikish, ckachayt

In the last two videos I've laid the foundation for understanding character data and integer data. Be sure to check those out.In this video we are going to be writing a program that will take a character and convert it to an integer.First, we will cover how to convert from ASCII to an integer. Then, we will convert it back.The next thing we will do is show that you can do math with characters. That's because they're really just numbers in disguise. #include (less than sign) stdio.h (great than sign) int main() { char ASCII; printf("Please enter a character: "); scanf("%c", &ASCII); printf("The int value of your character is: %d\n", ASCII); int integer; printf("Please enter an integer between 0 and 127: "); scanf("%d", &integer); printf("The ASCII for that int is: %c\n\n", integer); return 0; }Now, let's try to do some math with characters: //Math with ASCII: char mathz = 'A' + '\t'; printf("A(65) + \t(11) = %c(%d)\n", mathz, mathz); You can see that the \t is actually rendered. Remember how if we want to go to a newline we use \n, well we can also use \t! To actually print a backslash we need to use two back slashes. //Math with ASCII: char mathz = 'A' + '\t'; printf("A(65) + \\t(11) = %c(%d)\n", mathz, mathz);~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Support me! Subscribe to my newsletter: Donate!: . ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~More content: Facebook: Google+: Twitter: Amazing Web Hosting - (The best web hosting for a cheap price!)

Код ролика:

Ссылка ролика:

Комментарии (0)

Нет комментариев. Ваш будет первым!

.