Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
MemCpyClass
//g++ 7.4.0 ////////////////////////////////////////////////////////////////////////////////MemCpyClass // //void* memcpy(void* to,const void* from,size_t n); // //this code is created by Rezaul Hoque on July 11,2022; //contact:jewelmrh@yahoo.com;Dhaka,Bangladesh;https://rezaulhoque.wordpress.com,https://hoquestake.blogspot.com //note: codes shared by Rezaul Hoque on rextester are not for sale; they are created and shared to facilitate the algorithm learning process; many like Hoque use this platform to practice programming ;Rezaul hopes his contribution helps others to fine tune their learning; ///////////////////////////////////////////////////////////////////////////// #include <iostream> #include <string.h> class NamTel{ public: char name[25]; char tel[15]; NamTel(){} void disp(){ std::cout<<name<<"\n"<<tel;} }; int main() { char s[25]="yyyy"; char t[15]="###\n"; NamTel a; memcpy(a.name,s,strlen(s)+1); memcpy(a.tel,t,strlen(t)+1); a.disp(); NamTel c; memcpy(&c,&a,sizeof(a)); c.disp(); return 0; }
run
|
edit
|
history
|
help
0
Graph DFS
C++ state machine prototype
მატრიცა
matrix
Test
no copy elision
NamespaceOverload
basic caculate i
most Frequent word
Faaaaak