Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
strcpy
#include <iostream> #include <cstdio> #include <cstring> using namespace std; class Test{ public: char* name; Test():name(new char[10]){} void set(char* value){ /*int i=0; while(*value != 0){ *(name+i) = *(value++); ++i; } *(name+i) = 0;*/ strcpy(name,value); } }; int main(){ char in[10]; Test* data[3]; for(int i=0;i<3;++i){ scanf("%s",in);//input: A B C data[i] = new Test(); data[i]->set(in); } for(int i=0;i<3;++i){ cout<< data[i]->name<<endl;//output: A B C } return 0; }
run
|
edit
|
history
|
help
0
floyd alfa 1
xyp
SEGMENTED SIEVE
nobita's candies problem
Median of two sorted arrays
ForwardListString2
List Add v3
shuffle_example
Adress
UsingAlgorithm