The Geek Forum

  • May 23, 2024, 04:09:31 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Due to the prolific nature of these forums, poster aggression is advised.

*

Recent Forum Posts

Shout Box

Members
Stats
  • Total Posts: 129660
  • Total Topics: 7203
  • Online Today: 116
  • Online Ever: 1013
  • (January 12, 2023, 01:18:11 AM)

Author Topic: C++ Help  (Read 3838 times)

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« on: November 24, 2002, 05:07:10 PM »

Code: [Select]
// Hello world example
#include <iostream>
using namespace std;
int main()
{
  cout <<"Hello World!" << endl;
  return 0;
}


That works fine as a console application, but not as a Win32 app.  Even when I change iostream to windows.h, it still says I have errors.  

I'm using Visual Studio.  Any clue why it's happening?
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

Netrack

  • Jail Bait
  • *
  • Coolio Points: +0/-0
  • Offline Offline
  • Posts: 84
    • View Profile
C++ Help
« Reply #1 on: November 24, 2002, 05:22:33 PM »

mb try,  <iostream.h>

and do you get an error message? is what might be happening is that when you run it, it goes so quick that you dont see it
Logged

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« Reply #2 on: November 24, 2002, 05:26:24 PM »

Not in Visual Studio, it requires that you press a key before the prog ends.  

No error message, it just tells me that there's errors.  Usually 2-4.
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

Netrack

  • Jail Bait
  • *
  • Coolio Points: +0/-0
  • Offline Offline
  • Posts: 84
    • View Profile
C++ Help
« Reply #3 on: November 24, 2002, 06:05:49 PM »

well what do the errors say?
Logged

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« Reply #4 on: November 24, 2002, 06:13:40 PM »

It doesn't say.  

I wouldn't need to ask what's wrong with the code otherwise.   :P
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
C++ Help
« Reply #5 on: November 24, 2002, 07:41:19 PM »

It's too simple to be a win32 GUI app...

Have you tried the sample GUI app it comes with? There are like 4 pages of code...

the 'hello world' using cout was mainly meant for console apps
Logged

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« Reply #6 on: November 24, 2002, 07:46:56 PM »

Ooops.  Well, thanks for that.

Way to go, Jay.  WASTED TIME IS BAD BAD BAD WASTED TIME
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

hob goblin

  • Professional Blogger
  • ***
  • Coolio Points: +2/-2
  • Offline Offline
  • Posts: 651
    • View Profile
    • http://www.ice-on-fire.net
C++ Help
« Reply #7 on: November 24, 2002, 07:48:23 PM »

Console apps are so much cooler anyways, I'll let losers at microsoft code things like internet explorer and I'll stick to coding shell scripting, console apps, and web-backends...
Logged

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« Reply #8 on: November 24, 2002, 07:49:56 PM »

True, true.  

I ordered a book about enslaved programmers at Microsoft.  Hehehe.
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

HeavyJay

  • Hacker
  • ****
  • Coolio Points: +72/-1
  • Offline Offline
  • Posts: 1500
  • Gorn Tamer
    • View Profile
C++ Help
« Reply #9 on: November 25, 2002, 05:40:26 AM »

Ok, I've got much more figured out now than I did before.  Last time I ever make a mistake like that....
Logged
"Don't just eat that hamburger, eat the HELL out of it!" -- JR "Bob" Dobbs

Fade^C

  • Jail Bait
  • *
  • Coolio Points: +11/-2
  • Offline Offline
  • Gender: Male
  • Posts: 68
  • I am Jack's complete lack of surprise.
    • View Profile
C++ Help
« Reply #10 on: June 18, 2003, 09:17:12 AM »

MS visual studio has premade a win32 app with all the code (windows, etc) all done up for you.

If your just starting with C++ (or any language), stick with the console app first.
Logged
tl;dr

ho0ber

  • Wannabe Professional Blogger
  • **
  • Coolio Points: +29/-1
  • Offline Offline
  • Gender: Male
  • Posts: 582
    • View Profile
    • SDC-Music.com
C++ Help
« Reply #11 on: June 18, 2003, 01:59:47 PM »

dude, it's all about the console apps...  I took a programming course last year, and AP CS this year.  ALL console apps...  The GUI stuff is still just programming theroyapplied to event based programming.

What do people here think of .net?
Logged
-ho0ber

RotYourBrain

  • Annoying Newbie
  • *
  • Coolio Points: +0/-0
  • Offline Offline
  • Posts: 12
    • View Profile
C++ Help
« Reply #12 on: February 16, 2004, 04:44:46 AM »

Quote from: HeavyJay
Ok, I've got much more figured out now than I did before.  Last time I ever make a mistake like that....



HAHAHAHAHA!!!!!

::EDIT::
By the way, I don't trust .NET. It is like seeing the name 'George' on a womans drivers liscense.
Logged

hackess

  • Forum Moderator
  • Hacker
  • *
  • Coolio Points: +10/-0
  • Offline Offline
  • Posts: 4733
  • DFG
    • View Profile
C++ Help
« Reply #13 on: February 16, 2004, 09:00:36 AM »

STOP REVIVING DEAD THREADS, YOU SCHMUCK!
Logged

Anonymous

  • Guest
C++ Help
« Reply #14 on: February 16, 2004, 09:04:47 AM »

HAHAHAHHA!!!!!

::EDIT::

Cats are wise. They have 9 lives. You have 1. Listen to Cat.
Logged