hi
write a programming some peoples called a hard coding. what is hard code and which type of code is called as Hard Code.
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jaish MathewsPosted Apr 12, 2010, 2:58 AM
Here simple example.
Scenario - Need to access System Path
//Hardcoding
string filePath = "C:\WINDOWS\system32"
MessageBox.Show(s);
Problem-System folder will be changed based on OS and Machine.
//Dynamic coding
string filePath = Environment.GetFolderPath(Environment.SpecialFolder.System)
Advantage-Regardless of OS and Machine, correct value will be returned