Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

visual studio 2008 c++ and running the source

hello world visual studio 2008

  • Please log in to reply
7 replies to this topic

#1 jwxie518

jwxie518

    Speaks fluent binary

  • Senior Member
  • PipPipPipPipPipPip
  • 517 posts

Posted 31 January 2009 - 10:21 AM

hey guys, i am totally new to c++
i had already read some of the threads, but i just need help with something

i downloaded visual studio c++ 2008 express, i want to first test my hello world cpp file, but i only know how to compile and run it in Ubuntu, not with visual studio

so i create a fiel in studio, and it's hello world, how do i run the program now, to show the result of my code?

anyone is familiar with studio?
  • 0

#2 Kierien

Kierien

    CC Regular

  • Member
  • PipPipPip
  • 30 posts

Posted 31 January 2009 - 10:50 AM

By pressing "F5"
  • 0

#3 jwxie518

jwxie518

    Speaks fluent binary

  • Senior Member
  • PipPipPipPipPipPip
  • 517 posts

Posted 31 January 2009 - 11:30 AM

i don't see anything happen after pressing f5
// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}
and i save it as source1.cpp
nothing is being output...
  • 0

#4 Kierien

Kierien

    CC Regular

  • Member
  • PipPipPip
  • 30 posts

Posted 31 January 2009 - 11:47 AM

Debug>Start Debugging
  • 0

#5 jwxie518

jwxie518

    Speaks fluent binary

  • Senior Member
  • PipPipPipPipPipPip
  • 517 posts

Posted 31 January 2009 - 01:39 PM

Debug>Start Debugging


hi, thanks for your reply. i am srry to bother you guys, but here is the problem
it's in chinese, but you can see, start debugging (F5) is not available

i think i am missing something

Attached Thumbnails

  • 99.JPG

  • 0

#6 amrosama

amrosama

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 2765 posts

Posted 31 January 2009 - 01:58 PM

i see you are doing a console, theres no build or debugging because its not a project, you are editting a file, you have to start a project
do this:
-start a new project with the type console
-write your code in the cpp file
-F5
  • 0
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
www.amrosama.com | the unholy methods of javascript

#7 WingedPanther73

WingedPanther73

    A spammer's worst nightmare

  • Moderator
  • 17757 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others

Posted 31 January 2009 - 04:11 PM

Because it is a console app, the console is probably popping up for the output and then closing as soon as the program closes. Try adding a cin after the output to let you enter dummy data before close.
  • 0

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

My MineCraft server site: http://banishedwings.enjin.com/


#8 jwxie518

jwxie518

    Speaks fluent binary

  • Senior Member
  • PipPipPipPipPipPip
  • 517 posts

Posted 31 January 2009 - 04:38 PM

Hey guys, thanks a lot
for now i just have to create an empty project, right?
and thanks a lot with all the help, trying to learn c++
hahaha stick with php for a while already
  • 0





Also tagged with one or more of these keywords: hello world, visual studio 2008

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download