Results 1 to 7 of 7
Code:
//Author: Donald Farkas
//Created: Sep/4/2010
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
int houryWage, hoursWeek, yearSalary;
cout << "Please enter hourly wage: " << endl;
...
- 09-04-2010 #1Linux Newbie
- Join Date
- May 2009
- Location
- Kitchener, Ontario, Canada
- Posts
- 187
Created my first little program in C++ that im happy about
Code://Author: Donald Farkas //Created: Sep/4/2010 #include <iostream> using std::cout; using std::cin; using std::endl; int main() { int houryWage, hoursWeek, yearSalary; cout << "Please enter hourly wage: " << endl; cin >> houryWage; cout << "Please enter total amount hours per week:" << endl; cin >> hoursWeek; yearSalary = houryWage * hoursWeek * 52; cout << "Your yearly salary is " << yearSalary << " before taxes." << endl; return 0; }
I know its very simple but im proud i did not use any help with anything at all
- 09-05-2010 #2
great!
and congrats
that the best way
to write one and debug it is the proper procedure for any program. It is possible to write without making errors but we play it safe and check our work.
all too often software companies have several code writers that are working on their piece of the project and the software is patched together and it sometimes doesn't get retested during each phase before release.
therefore the reason for bug fixes and patches
- 09-05-2010 #3Just Joined!
- Join Date
- Sep 2010
- Posts
- 7
more info
congrats
can you please put the exact commands you used to compile this program, link this program and run this program, including any library environmental variable setups?
i am just starting on Linux but using plain C (not C++) and using GCC compiler, so I suspect my task will be similar to yours.
thanks
- 09-05-2010 #4Debian GNU/Linux -- You know you want it.
- 09-05-2010 #5Just Joined!
- Join Date
- Sep 2010
- Posts
- 7
- 09-05-2010 #6
None. Your distributor should have taken care of that job already.
The cc command, if called as above, automatically links the object file in order to produce an executable.
As I said, the compiler usually invokes the linker automatically for you. Unless he is told not to. If you wish to do it yourself, ld is the program.
GCC online documentation - GNU Project - Free Software Foundation (FSF)Debian GNU/Linux -- You know you want it.
- 09-06-2010 #7Linux Newbie
- Join Date
- May 2009
- Location
- Kitchener, Ontario, Canada
- Posts
- 187


Reply With Quote
