we have written cout<<E.tyres ; and it is showing 4.
but we haven’t changed the parameters in the object that we created in the main .
what does const parameters mean .and how can we make setName as a const parameter ?
we have written cout<<E.tyres ; and it is showing 4.
but we haven’t changed the parameters in the object that we created in the main .
what does const parameters mean .and how can we make setName as a const parameter ?
to declare a variable as const
just write const in front of data type
const int types
in the first doubt i meant that we haven’t passed tyres while creating the object .??
we are hardcoding its value
means we are not taking it from user and then assinging
we simply intialize it with 4 so no problem in it
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course