Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

C++ Builder: String MyString; What does it initialise to at declaration?

$
0
0

Trivial I know but:

I have got into the habit of using

// I use the following to ensure an empty string value...

String MyString = "";


But if I do not set an initial value, does String automatically create an empty string?

// Not setting an initial value, so is it filled with random stuff or empty?

String MyString;

Or does it do random (and often dangerous) like

// Using int without a default

int MyInt;

Yet

// Using int with a default causes a compiler warning that the value is never used!

int MyInt = 0;

 


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>