On Fri, 22 Dec 2023, 22:04 Andrew Pinski via Gcc, wrote:
> On Fri, Dec 22, 2023 at 1:54 PM Olavi Esker via Gcc
> wrote:
> >
> > Hello,
> >
> > #include
> > #include
> >
> > int main()
> > {
> > std::int8_t myInt{65};
> > myInt += 1;
> > std::cout << myInt;
> > }
> >
> > Guess what this returns
On Fri, Dec 22, 2023 at 1:54 PM Olavi Esker via Gcc wrote:
>
> Hello,
>
> #include
> #include
>
> int main()
> {
> std::int8_t myInt{65};
> myInt += 1;
> std::cout << myInt;
> }
>
> Guess what this returns?
> Character "B".
>
> int main()
> {
> std::int8_t myInt{};
> std::cin >> myInt;
> std::co
Hello,
#include
#include
int main()
{
std::int8_t myInt{65};
myInt += 1;
std::cout << myInt;
}
Guess what this returns?
Character "B".
int main()
{
std::int8_t myInt{};
std::cin >> myInt;
std::cout << myInt;
}
This will also read a character, and
print the characters ascii value.
So if I give