跳到主文
部落格全站分類:藝文情報
從記事本讀入每行的字串後, 我想再分割成數個字串例如, 讀入的字串str為 "R1 R2 R3 R4" , 我想分開成s1="R1", s2="R2", s3="R3", s4="R4"
以下是我的程式
#include<iostream>#include<fstream>#include<sstream>#include<string>using namespace std;
#define SIZE 20char line[SIZE];string str;string s1, s2, s3, s4;
int main(){
fstream input;input.open("c:\input_file.txt",ios::in);while(input.getline(line,sizeof(line),'\n')){
str = line;}
system("pause");return 0;}
This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers. Five Filters recommends:
中文名字日文翻譯, 中文翻譯日文名字, 名字日文翻譯, 日文翻譯名字, 日文翻譯字典發音, 日文翻譯網 漢字,
sdfgdf2 發表在 痞客邦 留言(0) 人氣()