Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
c++ - path question
Name: BabaG Date: May 26, 2008 at 23:48:29 Pacific OS: mandriva 2007.1 CPU/Ram: p4 Product: self
Comment:
is there a way to return the current a account in c++? i'm thinking of how to return something like "/home/babag."
i have a small app that i need to run on more than one box. once in the account, the paths will be pretty much the same on each. i'm thinking that if i can return the account home path, i can store it in one variable and store the rest of the path in ampther and put the two together to form the path for the current box.
for example, each box might be in variable1, while a common part of the path might be in variable2.
Name: klint Date: May 27, 2008 at 03:41:15 Pacific
Reply:
You can get the home directory from the environment table (getenv) but there is an easier way: use the character "~" which is shorthand for the home directory. For example, "~/path/to/app".
Summary: I have a basic C++ string question. Let's say that a function reads a string of any size from a data file or user. I need the function to reduce the amount of characters in that string by 1, from the ...
Summary: I'm new to using Visual Studio w/ C++. Two questions: - I added a file to a project and now I don't want that file as part of the project. How do I remove the file from the project. Just deleting th...
Summary: In my c project there is a function alloc.c. In alloc.c the array allocbuf is initialized as an array of characters in: static char allocbuf[ALLOCSIZE]; Q1: what does the keyword static do? (not the m...