Thank you for responding. As part of my learning exercise, I went through the above two examples you provided. For the particular problem I submitted, I want to use a char pointer to point to an array containing the character string entered after the prompt "Enter a sentence". I am bewildered on how to do this.
#include <cstdio>
#include <iostream>
#include <string>
usingnamespace std;
int main()
{
char* p_c_test;
char str[100];
// string str;
printf("Enter a string: ");
cin.getline(str, 100);
cout << "This is str after getline: " << str << endl;
// How do I get p_c_test to point to str?
p_c_test = &str;
int strLength = strlen(str);
cout << "str's length is : " << strLength << endl;
// cout << "This is what p_c_test is pointing at: " << *p_c_test << endl;
// p_c_test is pointing at the first character of the character string str.
// printf("The string entered is %u characters long.\n", (unsigned)strlen(str));
return 0;
}