|
-
Jan 4th, 2002, 11:46 PM
#1
Thread Starter
Member
C++ AND Dos
I am currently programming with Visual Basic but I am interested in learning C++. This is because I would like to try to start writing MSDOS programs. I was woundering if anyone had/ know where I can find an c++ program where it has the source files of basic functions (like Windows, Buttons, etc.) in dos. Not alot of extra stuff, because I want to learn from example. Any help will be awsome.
-
Jan 5th, 2002, 12:40 AM
#2
PowerPoster
just to let you know, VC++ can't make DOS apps.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Jan 5th, 2002, 12:55 AM
#3
Hyperactive Member
First program in C++
PHP Code:
#include <windows.h>
#include <iostream.h>
int main()
{
int x;
x = 90 / 10;
cout << "Hello World!!!\n 90/10 = " << x;
}
-
Jan 5th, 2002, 03:58 AM
#4
Hyperactive Member
Learning from examples is only efficient once you've read a book.
-
Jan 5th, 2002, 06:13 AM
#5
Addicted Member
try planetsourcecode, they have both source and tutorials......
here's the address:
http://www.planetsourcecode.com/xq/A...vb/default.htm
made_of_asp,
why do you have to include the windows.h-file? it's not necessary in that example.....
-
Jan 5th, 2002, 06:36 AM
#6
Monday Morning Lunatic
Originally posted by made_of_asp
First program in C++
PHP Code:
#include <windows.h>
#include <iostream.h>
int main()
{
int x;
x = 90 / 10;
cout << "Hello World!!!\n 90/10 = " << x;
}
A few things:
1. No need for windows.h (as stated)
2. Use iostream, not iostream.h. This means you'll need to bring in the std namespace. Complicated, but that's the way the standard goes.
3. You need to return a value from main.
4. You didn't put a newline at the end of your output statement so anything after it (including the DOS / command prompt) will end up on the same line.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 5th, 2002, 07:43 AM
#7
Hyperactive Member
Thanks parskie for corrections but i always use windows.h and iostream.h and the testing project is small anyway so new line isnt required.
-
Jan 5th, 2002, 08:23 AM
#8
Monday Morning Lunatic
You're missing my point.
Using iostream.h is officially the Wrong Way To Do It.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Jan 5th, 2002, 08:20 PM
#9
Hyperactive Member
Sorry but i dont know the difference between
#include <iostream>
using namespace std;
and
#include <iostream.h>
to me they work the same
-
Jan 6th, 2002, 05:08 AM
#10
Monday Morning Lunatic
They're supposed to work the same. They're just implemented differently.
The newer library is based around templates, which simplifies a lot of things. However, the way you use it is more or less identical. For now, use the new one...you'll eventually work out the differences but it's pretty tricky unless you've been doing it for ages.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|