How to link with input vertex data?

This is a simple vertex shader,
in vec3 VertexPosition;
in vec3 VertexColor;
out vec3 Color;

void main()
{
Color =VertexColor;
gl_Position = vec4(VertexPosition,1.0);
}

Where is VertexPosition? from .cpp, we have positionData array, How to find the pointer VertexPositoin points to the data?

[QUOTE=reader1;1264888]
Where is VertexPosition? from .cpp, we have positionData array, How to find the pointer VertexPositoin points to the data?[/QUOTE]
You can use glGetAttribLocation() after the program is linked to obtain the index for an attribute, or glBindAttribLocation() before the program is linked to set it to a specific value. Or you can use a layout(location=…) specifier in the variable’s declaration to assign a specific index.

Arrays of data are associated with an attribute index using glVertexAttribPointer().

[QUOTE=GClements;1264890]You can use glGetAttribLocation() after the program is linked to obtain the index for an attribute, or glBindAttribLocation() before the program is linked to set it to a specific value. Or you can use a layout(location=…) specifier in the variable’s declaration to assign a specific index.

Arrays of data are associated with an attribute index using glVertexAttribPointer().[/QUOTE]
Thank you very much for the porompt reply. I find an article about this issue, which is as same as your descriptoin