![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2004
Posts: 4
Rep Power: 0
![]() |
these are the questions i cant solve. please help
1. Write a C++ program that has the usage makefd [-f | -d] path that will make either a file or a directory of the name path depending on the option provided. No option means make a file. Perform error checking particularly in association with incorrect usage. Use the functions. int creat(const char* pathname, mode_t mode); int mkdir(const char* pathname, mode_t mode); to perform the create with the appropriate access modes. 2.a programmer wishes to build a C program called videostore from a source file call videostore.cpp/ the source file depends on the header file videostore.h, which is in the parent directory. the programmer wishes to define, at compile time, the symbol STOREMAX as 1000. assuming the programmers current directory is the same as that of the source file, what compile directive would be used to build the program (using CC or cc in UNIX) |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
Since this is homework... I need to know what YOU have TRIED so far... in order to better help you. Post some code, show that you have made a valid attempt at a solution. Specific questions instead of your homework assignment posted would probably be easier to address.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#3 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
1.) (in pseudo code)
int main(int argc, char *argv[])
{
if(argc!=2 || argc!=3)
{
print error message
exit
}
if(argv[1] is -f)
{
make your file using argv[2]
}
else if(argv[1] is -d)
{
make your directory using argv[2]
}
else
{
make file using argv[1]
}Moe specific questions would be nice. Also, I don't know if this is what you're looking for on #2 but #define STOREMAX 1000 ????????
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
More specific questions are better than posting just the homework assignment for sure. I'll hold off on posting code until I see an initial attempt. I was also thinking
that #define STOREMAX 1000 was the answer for number two. The directory and header stuff is probably just filler info to throw some people off.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#5 |
|
Programming Guru
![]() ![]() |
Not to sound like an ass, but i don't know about the rest of everyone, but i am here to help, not complete peoples home work that may / may not have been attempted yet.
<Disclaimer> Sorry if anybody got offended by my post, i just think it's better to try a few times, do some research on my own then come to the forums for help. Excuse me for being blunt. </Disclaimer> -Pizentios
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#6 |
|
Programming Guru
![]() ![]() ![]() |
my sentiments exactly,
#1. Show that you have made a valid attempt at a solution. #2. Specific questions, not a copy and paste of your assignment.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#7 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Cut the guy some slack. You all must remember what it was like to be in school, and have abrupt stages where laziness would just hit you.
Panabook, it would be nice if you would give more specific problems, and also show us what you have tried, before asking a question. That way it's easier for us to help you. We don't have to rewrite everything, just correct whatever mistakes you have made. And I certainly hope that you wouldn't have us do your entire problem for you. You don't learn anything that way. Either way, I hope you got your problem solved. If you need any more help, just post.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#8 |
|
Newbie
Join Date: Jul 2004
Posts: 4
Rep Power: 0
![]() |
Hi,
I have an exam tomorrow and i cant seem to answer these specific questions which are in past exam papers. i have alot of content to study and am just trying to get things done quicker. if it was homework i would try to figure it out myself. thanks for the replies. |
|
|
|
|
|
#9 | |
|
Programming Guru
![]() ![]() ![]() |
Quote:
In addition to that, a lack of planning on his part does not constitute an emergency on our part. I procrastinate all of the time... especially so when I was in college. I know how it is. Simply put, he will learn nothing if we do it for him, we need specific questions and a show of his effort. For the record, I'm still willing to attempt to answer this question AFTER an attempt is made by the person that formed the inquiry.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|