Home:ALL Converter>Declaration and Definition about integral types

Declaration and Definition about integral types

Ask Time:2018-02-12T18:24:38         Author:chaviaras michalis

Json Formatter

I am a little bit confused about this two notions. I am reading the "C++ Programming Language", Bjarne Stroustrup. According to this book, the following are declarations and definitions :

char ch; //(dec. and def.)
string s; //(dec. and def.)
int count=1; //(dec. and def.)

But there is an exercise (4.11) that says " For each declaration in §4.9, do the following: If the declaration is not a definition, write a definition for it. If the declaration is a definition, write a declaration for it that is not also a definition."

So I am confused how can we write the declaration without the definition for the above three things ??

Author:chaviaras michalis,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/48744152/declaration-and-definition-about-integral-types
yy