r/cpp_questions • • 22d 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

9

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

3

u/Escritor_CdK 22d ago

ok thats what i needed