Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

I still can not see what I've compiled.


  • Please log in to reply

#1
nick_mi

nick_mi

    Member

  • Member
  • PipPipPip
  • 272 posts
According to thos topic
http://www.geekstogo...showtopic=79355

I've tried changing the return to 1, and I entered the code that swan gave me, but still no go. :tazz:

Alright, after doing a bit of toying around, I noticed when I compile it, it opens and closes(disapears), but each time for a brief second I can see it, and they're not coming in the same place, they're almost opening like when you open multiple pages then compound them so that they are staired so they open just a LITTLE BIT down right of the previous one.

Also, on Friday, when I was doing this, when I logged onto a computer across the school I had a lot of dos windows pop up on me right at the begingin and I had to exit then all. They were not what I compiled, but just a lot of different dos files with different names at the header.

I just tried spamming it, then logging off of this computer and logging back on, no go. Then I spammed it agian logged off of this computer and logged onto to another computer but still no go! >_<

Edited by nick_mi, 21 November 2005 - 10:17 AM.

  • 0

Advertisements


#2
nick_mi

nick_mi

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 272 posts
Ok, I'm on this computer again, and I think it is just the computer, here are some of the names

id.exe
ts.exe
dlgb.exe
rgrt.exe
  • 0

#3
nick_mi

nick_mi

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 272 posts
Alright, I went to a different tutorial and used a different code snipit.

This works

#include <iostream>

using namespace std;

int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}




This doesn't work

// my first program in C++

#include <iostream>
using namespace std;

int main () { cout << "Hello World"; return 1; }


  • 0

#4
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
That's because this line:

cin.get();

will make the program halt and wait for a buffer of input. Once it receives its input it will throw it away and quit. :tazz:
  • 0

#5
nick_mi

nick_mi

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 272 posts

// my first program in C++

#include <iostream>
using namespace std;

int main () { cout << "Hello World"; return 1; cin.get(); }


Stilll auto closes. o.O
  • 0

#6
Swandog46

Swandog46

    Malware Expert

  • Member
  • PipPipPipPip
  • 1,026 posts
  • MVP
That's because you gave it the return command before the cin.get command. :tazz:

Try:
{ cout << "Hello World"; cin.get(); return 1; }

I still think that's an ugly solution, and if you really want it to pause you should be using some system function like:

#include <stdlib.h>

system("PAUSE");
  • 0

#7
nick_mi

nick_mi

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 272 posts
k <3
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP