std::string is just a wrapper around a char * and from reading the function you do not want to change it back to char anyway
If you must you would still go via std::string str.c_str() converts a string back to the array pointer which is what you are doing when you don't set a size you set a char array1 = "hello"; you have a pointer called array1
#include <string> // std::string
#include <iostream> //output
//this is the same as char array1
char array1 = "hello baby";
std::string temp = array1;
int first(0), last(5);
char small_temp = temp.substr(first, last - first);
//write the string
std::cout << "small_temp = " << small_temp << std::endl;
char array2 = small_temp.c_str();
basically although you appear not to realise it you want to use a
std::string and if you need a char * or char  just use a std::string with .c_str() function.
Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...