Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
char pointer in class
#include <iostream> using namespace std; class Test{ public: char* name; Test(char* n):name(n){} }; int main(){ char in[10]; Test* data[3]; for(int i=0;i<3;++i){ cin>>in;//input: A B C data[i] = new Test(in); } for(int i=0;i<3;++i){ cout<< data[i]->name<<endl;//output: C C C } return 0; } // why???
run
|
edit
|
history
|
help
0
Kadane's Algorithm
Common elements in 3 sorted vectors with extra space
hilbert
ignat
2021(M2)Simulare:S3:1
sysFork3
Connected components in complement graph
mur1
Avoiding visited networked paths
scemo dd