C++/C++

Advertisement


Question
what is static data binding and dynamic data binding ?

Answer
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

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Eddie

Expertise

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.

Experience

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.

©2016 About.com. All rights reserved.