C/Data Type/Decimal


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

Print the decimal equivalent of each character: using pointer

#include <string.h>
#include <stdio.h> 
int main(void)
{
  char *p1;
  char s[80];
  do {
    p1 = s; /* reset p1 to beginning of s */
    gets(s);  /* read a string */
    /* print the decimal equivalent of each
       character */
    while(*p1) printf(" %d", *p1++);
  } while(strcmp(s, "done"));
  return 0;
}