why in this code the "codeArray[]" is used??
what does its really means??

#include <iostream>
using namespace std;

void FunctionTwo (int codeArray[]){
     cout<<codeArray[1];
}


int main()
{

int codeArray[3] = {1,2,3};

FunctionTwo(codeArray);
}

Thank You for helping...

why in this code the "codeArray[]" is used??
what does its really means??

void FunctionTwo (int codeArray[]){
     cout<<codeArray[1];
}

When you declare a function parameter as an array, what really happens is that a pointer to the first element of the array is passed, not the entire array. It's basically the same as this:

void FunctionTwo (int* codeArray){
     cout<<codeArray[1];
}

Here's a page with some more explanation.

commented: It's all good :) +6
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.