c语言atoll函数怎么用

C ++ Atoll()函数 (C++ atoll() function)

atoll() function is a library function of cstdlib header. It is used to convert the given string value to the integer value. It accepts a string containing an integer (integral) number and returns its long long long integer value.

atoll()函数cstdlib标头的库函数。 它用于将给定的字符串值转换为整数值。 它接受包含整数(整数)的字符串,并返回其long long long整数值。

Syntax of atoll() function:

atoll()函数的语法:

C++11:

C ++ 11:

    long long int atoll (const char * str);

Parameter(s):

参数:

  • str – represents a string containing an integer (integral) number.

    str –表示包含整数(整数)的字符串。

Return value:

返回值:

The return type of this function is long long int, it returns the long long long integer converted value.

此函数的返回类型为long long int ,它返回long long long long整数转换后的值。

Example:

例:

    Input:
str = "123456789012345";
Function call:
atoll(str);
Output:
123456789012345

C ++代码演示atoll()函数示例 (C++ code to demonstrate the example of atoll() function)

// C++ code to demonstrate the example of
// atoll() function
#include <iostream>
#include <cstdlib>
#include <string.h>
using namespace std;
// main() section
int main()
{
char str[50];
strcpy(str, "123456789");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
strcpy(str, "-123456789");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
strcpy(str, "0");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
strcpy(str, "9876543120");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
strcpy(str, "-9876543120");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
strcpy(str, "123456789012345");
cout << "atoll(\"" << str << "\"): " << atoll(str) << endl;
return 0;
}

Output

输出量

atoll("123456789"): 123456789
atoll("-123456789"): -123456789
atoll("0"): 0
atoll("9876543120"): 9876543120
atoll("-9876543120"): -9876543120
atoll("123456789012345"): 123456789012345

Reference: C++ atoll() function

参考: C ++ atoll()函数

翻译自: https://www.includehelp.com/cpp-tutorial/atoll-function-with-example.aspx

c语言atoll函数怎么用

c语言atoll函数怎么用_C ++中带有示例的atoll()函数相关推荐

  1. c++ cdi+示例_C ++中带有示例的本地类

    c++ cdi+示例 C ++中的本地类 (Local Class in C++) In C++, generally a class is declared outside of the main( ...

  2. c语言 函数的参数传递示例_C ++中带有示例的nearint()函数

    c语言 函数的参数传递示例 C ++附近的int()函数 (C++ nearbyint() function) nearbyint() function is a library function o ...

  3. nanf flash校验_C ++中带有示例的nanf()函数

    nanf flash校验 C ++ Nanf()函数 (C++ nanf() function) nanf() function is a library function of cmath head ...

  4. c++ abort 函数_C ++中带有示例的abort()函数

    c++ abort 函数 C ++ abort()函数 (C++ abort() function) abort() function is a library function of cstdlib ...

  5. R语言笔记6:在R中写一些简单的函数、functions基础和作用域

    R语言基础系列: 1数据类型(向量.数组.矩阵. 列表和数据框) 2读写数据所需的主要函数.与外部环境交互 3数据筛选--提取对象的子集 4向量.矩阵的数学运算 5控制结构 Your first R ...

  6. c语言 字符串字符反向储存_C ++中的反向字符串

    c语言 字符串字符反向储存 In many situations, we may need to reverse a string in C++ programming. It may include ...

  7. R语言笔记6:在R中写一些简单的函数

    Your first R function 命令一个函数时,一般不写在交互式命令行里,而是写在一个空白的文本文件中,即把函数放在一个R包中,这里面包含着文档(documentation),是一个更加结 ...

  8. c语言中swap函数_C ++中的swap()函数

    c语言中swap函数 介绍 (Introduction) In this tutorial, we are going to learn the swap() function in C++ prog ...

  9. c语言中exit函数_C ++中的exit()函数

    c语言中exit函数 介绍 (Introduction) Today we'll learn about exit() in C++. We know we can break out of loop ...

最新文章

  1. xcode4自定义文件模板(Creating Custom Xcode 4 File Templates)
  2. python3入门与进阶笔记_我的Python3萌新入门笔记
  3. 【已解决】Exception in thread “Thread-0“ redis.clients.jedis.exceptions.JedisConnectionException: java.n
  4. angularjs 同步請求_angularjs $q、$http 处理多个异步请求
  5. sublime怎么运行go_使用SublimeGDB调试Go程序
  6. Effictive Java学习笔记1:创建和销毁对象
  7. arcgis多个数据融合python_使用Python在ArcGIS中添加多个字段名
  8. Linux内核通知链(Notifier)
  9. 一个移动开发老码农的书单
  10. android kitkat(4.4以上)各个版本的特性解析
  11. 蔡颖-《APS走向实践》书解读之二:需求驱动-预测、掌握、满足需求
  12. 华为ModelArts(声音分类与文本分类项目的创建及使用)
  13. HTML插入一条竖线
  14. MySQL 之JDBC编程
  15. 详解计算机内存及基于内存理解的几种数据结构
  16. 视频学习笔记------系统学习让你轻松定义 Java 类加载器
  17. 党校报告称中国使用互联网每年需向美国付5000亿
  18. 让我摘下星星送给你_抖音中摘下星星给你摘下月亮的歌词是什么歌 星球坠落歌词在哪听...
  19. 手机c语言图形界面编程工具,「分享」C语言如何编写图形界面
  20. 如何在项目管理中定义可交付成果?

热门文章

  1. java url 本地文件是否存在_我的应用程序知道URL中是否存在文件会一直停止[重复]...
  2. java 持续集成工具_Jenkins-Jenkins(持续集成工具)下载 v2.249.2官方版--pc6下载站
  3. java xml date_W3C XML 模式时间数据类型与java Date进行转换
  4. gradle 查看依赖类库版本_Android studio中查看依赖的第三方库的历史版本和最新版本...
  5. crv仪表上的i是什么指示灯_汽车打不着火是怎么回事,仪表盘汽车发动机故障灯亮是什么情况故障指示灯图解大全集...
  6. wind试用版 matlab,免费产品试用 - MATLAB Simulink
  7. 【SpringBoot 2】(五)自动配置简析源码 开发中小技巧
  8. Docker容器间网络通信
  9. Nginx(零):背景
  10. Angular Web App部署Linux Nginx Https