Re: [問題] 為什麼我無法使用atoi(c語言)
※ 引述《dodomax (肥狗)》之銘言:
: 我有include stdio.h也有stdlib.h
: 可是用itoa會產生錯誤訊息
: 只能改用spintf
: 可是我還是不太懂為什麼我無法使用itoa?
#include <iostream>
using namespace std;
main()
{
char *a="123";
int s=atoi(a);
cout<<s+2<<"\n";
cout<<a+1<<"\n";
system("PAUSE");
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 60.198.94.131
推
06/14 11:39, , 1F
06/14 11:39, 1F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 3 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章