using const in func declaration.

May 5, 2012 at 10:23pm
Hi


If i do something like:

1
2
3
4
5
6
#include <iostream>
using namespace std;

void test(const int a[], double example);



would that make example a constant as well as a?



i would just try it but im on my phone..
May 5, 2012 at 10:26pm
No. a is actually not even const. a is a pointer to a const int.
May 5, 2012 at 10:31pm
1
2
3
4
5
#include <iostream>
using namespace std;

void const test(int a[], double example);


would this work?
May 5, 2012 at 10:35pm
No.
May 5, 2012 at 10:40pm
What exactly is he (Omar Alamy ) trying to do??
May 5, 2012 at 10:43pm
Learn, I guess.
Topic archived. No new replies allowed.