![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Nice work mate.
|
|
|
|
|
|
#12 |
|
Expert Programmer
|
Glad that this tutorial has gone to some use an helped someone
![]() Extra bit While argv[n] can show you an argument, you can also find the filename too, by using argv[0]. This is because the first word you type is counted in the argv array. I thought my indenting was ok, some things aren't aligned to well as i was having trouble with the second example.
__________________
Join us at #programmingforums @ irc.freenode.net! My software never has bugs. It just develops random features.
|
|
|
|
|
|
#13 | ||
|
Programmer
Join Date: Jun 2005
Posts: 86
Rep Power: 4
![]() |
This part contains a lot of extremely BAD advice:
Quote:
g++ -o myfile myfile.cpp this will create an executable called myfile instead of a.out. As for executing a file, you can either type ./myfile or set your PATH variable to include . in its path. Quote:
Under no condition should you put crap in /usr/bin (or any such system directory, e.g. /sbin, /bin, /usr/sbin etc.) For one, it requires root privileges and secondly, you could overwrite some valuable system utility with your test program. |
||
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|