ASCII value converter
int main(int argc, char *argv[]){
    //Declare Variables.
    string input;
    int size;


Don't declare variables until you actually need them, and don't declare variables you don't need. In this case, you're not using the arguments passed into main, either don't name them, or use the version of main that takes no arguments:

int main() { /* space or newline between paren and curly is usual */




cin &gt;&gt; input;


I'm not sure this is what you want. If the user enters a "sentence" with spaces in it, you'll only get what they typed up to the first space (not included). If you want the whole line, use std::getline.

std::string input;
std::getline(std::cin, input);




//Copy the string into a character array.
const char * chars = input.c_str();


This comment is dangerously wrong. You don't get a copy at all, you get a pointer to std::string's internals. The string data is not copied, and the pointer returned will become invalid as soon as input's lifetime ends.

std::string's length() member returns an unsigned quantity. While there's no problem in this case assigning it to an int, the correct type to use is:

std::string::size_type size = input.length();


or more conveniently:

auto size = input.length();


(And you'll need to use an unsigned quantity for the loop counter too, to avoid warnings.)



A different way of doing your loop would be to use the range-based variant. It works for std::string.

for (auto c: input) {
  std::cout &lt;&lt; "Char \"" &lt;&lt; c &lt;&lt; "\" has value " &lt;&lt; static_cast&lt;int&gt;(c)
            &lt;&lt; std::endl;
}


This avoid getting the size altogether.