Sunday, September 13, 2015

Program to print directory path

If we want to print path like C:\TC\BIN to our console,  what we will do, we will put this string in printf like this

printf("C:\TC\BIN");

But the output will not be same as expected. Because there are some special symbols in the string those are making trouble for us. So we need to place extra backslash (\) to ignore those special symbols.

so the statement printf("C:\\TC\\BIN") will output as we want.

0 comments:

Post a Comment

Powered by Blogger.