C++ —用sstream把int转成string类型的方法
Best Ways to Trim a string in C++ [stackoverflow]

invalid conversion from ‘const char*’ to ‘char’

Author posted @ 2013年2月19日 03:24 in C/C++ , 3923 阅读

In C++, the token " " is a string literal which represents an array of two characters: the value of a space in the character set (eg, the value 32 in ascii) and a zero. On the other hand, the token ' ' represents a single character with the value of a space (usually 32). Note that in C, the token ' ' represents an integer with the value of a space. (In C, sizeof( ' ' ) == sizeof( int ), while in C++, sizeof( ' ' ) == 1.)

so getline(cNum, 255, " ") should be getline(cNum, 255, ' ') to get every word in one line

 char cNum[255];
 in_file.getline(cNum, 255, ' ');
 data = atof(cNum); //atof returns to double
 cout<<data<<" ";
seo 说:
2021年12月23日 02:40

i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. Canadian national holidays

SEO 说:
2022年2月25日 12:39

When you use a genuine service, you will be able to provide instructions, share materials and choose the formatting style. https://www.posterprintcenter.com/retractable-banners.html


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter