arrays and pointers
Sun Oct 29 2023 09:08:59 GMT+0000 (Coordinated Universal Time)
Saved by
@yolobotoffender
#include<iostream>
using namespace std;
int main(){
int size =100;
char *pointer = new char [size];
cout<<"enter the first array: "<<endl;
for(int i=0;i<size && *pointer != '\0';i++){
cin>>*pointer;
}
char arr[size];
cout<<"enter the second array: "<<endl;
cin.get(arr,size);
for(int i=0;i<size && arr[i] != '\0';i++){
cout<<arr[i];
}
return 0;
}
content_copyCOPY
Comments