48.9k views
4 votes
C++ automatically places ________ at the end of a string literal.

User Ticex
by
7.5k points

1 Answer

3 votes
c++ automatically places a '/0' character at the end of a string literal. This character represents null and is used o represent the end of the string. As a string in c++ is represented as an array of characters it will iterate through the array until reaching the null terminator which indicates it is at the end of the string and can stop.
User Abintom
by
7.8k points