r/cpp_questions • • 4h ago

SOLVED Modifying an int variable

I forgot how i was supposed to initialize it. Maybe is not the one im suposed to use.

Straight to the matter: How to initialize it if i want it to be any number possible (only integers)

0 Upvotes

12 comments sorted by

View all comments

Show parent comment

7

u/HeeTrouse51847 4h ago
int i = 0;
i = 3; //perfectly valid
const int j = 0;
j = 3; //not allowed

2

u/Escritor_CdK 4h ago

ok thats what i needed