C Tutorial/stdlib.h/strtoll — различия между версиями


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++ эксперт
Перейти к: навигация, поиск
м (1 версия: Импорт контента...)
 
(нет различий)

Версия 14:21, 25 мая 2010

strtoll

Item Value Header file stdlib.h Declaration long long int strtoll(const char * restrict start, char ** restrict end, int radix); Function converts the string into a long long and returns the result.


#include <stdlib.h>
  #include <ctype.h>
  #include <stdio.h>
  int main(void)
  {
    char *end, *start = "100.00 AAA 200.00 BBBB";
    end = start;
    while(*start) {
      printf("%f, ", strtoll (start, &end));
      printf("Remainder: %s\n" ,end);
      start = end;
      /* move past the non-digits */
      while(!isdigit(*start) && *start) start++;
    }
    return 0;
  }