what is static data binding and dynamic data binding ?

Hello dev, thank you for the question.

Static data binding is where you assign values at compile time. Dynamic data binding is where you assign values at run time, such as creating a specific number of items based on user input. Here is an example:

// in main
const int numItems = 5;
int array[numItems] = {1, 2, 3, 4, 5};

int userNumItems = 0;
cout << "Enter the number of items: ";
cin >> userNumItems;

int array2[userNumItems];

The first array has its size assigned at compile time, whereas the second array has its size determined by user input. This is considered dynamic data binding.

I hope this information was helpful.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by ExpertRating.com. I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2017 About.com. All rights reserved.