标签:blog os io for ar 2014 cti div
/********************************************************************
@file Main_practise.cpp
@date 2014-8-19
@author Tiger
@brief 範例:複製字串
@details 無論電腦再怎麼強,還是得逐字複製。
********************************************************************/
#include <iostream>
const int SIZE = 15;
void copy(char* s, char* t);
int main(int argc, const char* argv[])
{
char s[SIZE] = "incremental";
char t[SIZE] = {0};
copy(s, t);
std::cout << s << std::endl << t << std::endl;
system("pause");
return 0;
}
void copy(char* s, char* t)
{
int i = 0;
for (; s[i]!=‘\0‘; ++i)
{
t[i] = s[i];
}
t[i] = ‘\0‘;
}
标签:blog os io for ar 2014 cti div
原文地址:http://www.cnblogs.com/roronoa-zoro-zrh/p/3921213.html