How would I write a program that can tell what directory it is in?
For example, how would I write a program that can tell if it is in C:\Windows or C:\Users or something like that.

You could modify the examples given in one of the links below, and some basic C++ String matching.

1. http://stackoverflow.com/questions/143174/c-c-how-to-obtain-the-full-path-of-current-directory

2. http://msdn.microsoft.com/en-us/library/aa364934%28VS.85%29.aspx

How would I write a program that can tell what directory it is in?
For example, how would I write a program that can tell if it is in C:\Windows or C:\Users or something like that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.