http://www.open-open.com/code/view/1439430860036
2015.08
#include<iostream>#include<stdio.h>#include<string>using namespace std;int substr(char *str,unsigned start, unsigned len){ string temp; for(unsigned curr=start;curr<start+len;curr++){ char tmp=str[curr]; temp+=tmp; } cout<<temp<<endl; return 0;}int main(){ char *test="wewesdsfadfdss"; substr(test,3,3); return 0;}
联系客服