+ 1

const int N= 5; int a[N]; did I can change the value of N?

this is declare for a function top up my main function, but I want cin>>N,not const N=5, so want can I do to change the value of N in main function?help me!

11th Dec 2016, 12:03 PM
Eric Lai
Eric Lai - avatar
2 Antworten
+ 2
no . whats point in writing constant then???
11th Dec 2016, 1:56 PM
manish rawat
manish rawat - avatar
0
constants can't change since n is an int say int n cin >> n and n can change through the program if needed
11th Dec 2016, 12:33 PM
Abdelrahman