Having trouble with my compilier (the very first step)

This is a discussion on Having trouble with my compilier (the very first step) within the C Programming forums, part of the General Programming Boards category; I have visual studio 08 and was attempting to copy and paste Code: #include <stdio.h> int main() { printf( "I ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    38

    Having trouble with my compilier (the very first step)

    I have visual studio 08 and was attempting to copy and paste

    Code:
     #include <stdio.h>
    
    int main()
    {
      printf( "I am alive!  Beware.\n" );
      getchar();
      return 0;
    }

    from this website Cprogramming.com Tutorial: Introduction to C as instructed. My problem (at least I think this is the problem) is I'm new to the application and couldn't find the right type of project to create. I attempted to enter it in a text file instead of project, but when I click build then build solution I encounter errors with both methods.

  2. #2
    Registered User
    Join Date
    Nov 2004
    Location
    India
    Posts
    515
    What errors do you get?
    Code:
    >+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    38
    1 - Preprocessor directive expected

    2 - Single-line comment or end=of-line expected

    3 - A namespace does not directly contain members such as fields or methods

  4. #4
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    sounds like you're compiling as C++
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    38
    Any advice or tips on how to use Visual Studio 2008.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    38
    I spoke with someone about the issue and found out VS08 was probably too complicated of an application to learn C with. I tried the same thing with Dev-C++ and everything went right on the first try. I'll just use Dev-C++ for now. Thanks for all the help.

  7. #7
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    Just for future reference:

    Using VC++8.0 to create a C console application/project

    Code:
    1 New Project
    2 Click Win32/64 console Applicaiton
    3 Enter project name
    4 Dis-able pre-defined header files
    5 Click Ok
    6 Click "Add to project"
    7 Click .cpp file
    8 Name it <file name here> .c <- VERY IMPORTANT
    9 Click OK
    your done!

    When you compile the program it will compile it as C not C++
    I'm just trying to be a better person - My Name Is Earl

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. scanf trouble
    By sloke in forum C++ Programming
    Replies: 4
    Last Post: 11-16-2005, 03:31 PM
  2. recursion
    By paulmedic555 in forum C Programming
    Replies: 26
    Last Post: 01-28-2005, 12:43 AM
  3. robot step sizes
    By n00by in forum C Programming
    Replies: 2
    Last Post: 04-29-2004, 04:29 PM
  4. step by step debug != run debug
    By bonkey in forum Windows Programming
    Replies: 8
    Last Post: 09-09-2002, 01:55 PM
  5. this sites Compiler Resources Specs.
    By Powerfull Army in forum C++ Programming
    Replies: 9
    Last Post: 07-08-2002, 07:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21