Ok, what?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • super-smashman
    FFR Player
    • Nov 2004
    • 2638

    #1

    Ok, what?

    Ok, so I'm trying to learn C++ because we're doing VB in class and our class is moving extremely slowly. I don't understand what exactly a compiler is (I get what it does though) and where I can get one.
  • chickendude
    Away from Computer
    FFR Simfile Author
    • Sep 2003
    • 1901

    #2
    RE: Ok, what?

    A compiler is a program that converts source code into computer language. You need it or your program will just be a bunch of letters thrown into a file.

    easy to install compilers can be bought at most computer stores
    I know there's a free one called GCC, you can find it online with google or something
    but its a pain to install & use
    you have to write your programs in notepad, save them as .c s and then go into dos prompt and compile it from there

    like gcc helloworld.c

    My school uses it, and I have it installed on my comp, it works, but it doesn't have the other compiler amenities (text editor GUI, etc)

    Comment

    • ad0gg
      FFR Player
      • Dec 2003
      • 989

      #3
      RE: Ok, what?

      Try Dev-C++. It is very easy to use and has an IDE. http://www.bloodshed.net/devcpp.html

      Comment

      • super-smashman
        FFR Player
        • Nov 2004
        • 2638

        #4
        RE: Ok, what?

        Ugh, stupid everything...

        Ok so I'm (tying to) follow this guide that tells me to write this code and compile it.

        I wrote it and saved it as .cpp

        Code:
        #include <iostream.h>
        
        int main&#40;&#41;
        &#123;
            cout << "Hello World!\n";
        return 0;
        &#125;
        I installed Dev-C++ and I opened the hello.cpp file and went to Execute-> Compile. What next?

        It (the guide) tells me to run Hello.exe but I can't find it in the folder where the .cpp file is or in the program folder.

        Comment

        • ad0gg
          FFR Player
          • Dec 2003
          • 989

          #5
          RE: Ok, what?

          Try using the "Compile and Run" option. It should be right underneath "Compile" in the "Execute" menu (or maybe above).

          Comment

          • super-smashman
            FFR Player
            • Nov 2004
            • 2638

            #6
            RE: Ok, what?

            It says that its compiling and thats it. It closes and nothing runs.

            Comment

            • ad0gg
              FFR Player
              • Dec 2003
              • 989

              #7
              RE: Ok, what?

              Oh, add this statement on the line before "return 0;":
              Code:
              system&#40;"PAUSE"&#41;;
              That's the only downside with Dev-C++. You have to add that line in every program if you don't want it to quit immediately.

              Comment

              • talisman
                Resident Penguin
                FFR Simfile Author
                • May 2003
                • 4598

                #8
                RE: Ok, what?

                there's probably torrents of visual C++ floating around somewhere. but ffr doesn't endorse that I'm sure.

                the only compiler I've ever used is visual C++

                Comment

                • soccr743
                  FFR Player
                  • Dec 2003
                  • 549

                  #9
                  RE: Ok, what?

                  More like there is a beta of Visual Studio 2005 on Microsoft's website if you search for it. It is a very nice thing to have (Personally I use Visual Studio 2003 with VisualAssistX [Nice add on to Visual Studio but expensive])

                  Also, ad0gg, its not a downside to Dec-C++. Every compiler will compile that code the same and it will run and then display nothing. Now, you can always open up the command prompt and then open up your exe from there. Then it will just return to the command prompt and not the OS.

                  -----Soccr743-----

                  Comment

                  • nickadeemus
                    The spice must flow.
                    • Aug 2003
                    • 807

                    #10
                    RE: Ok, what?

                    In my CP class, the school sells us the 7 disc VS.net 2003 and library stuff for $7. They had it online for free, but it was using too much space, so the price comes from the CD's. Maybe I could hook you up with another copy.
                    Nice.

                    Comment

                    • ad0gg
                      FFR Player
                      • Dec 2003
                      • 989

                      #11
                      Re: RE: Ok, what?

                      Originally posted by soccr743
                      Also, ad0gg, its not a downside to Dec-C++. Every compiler will compile that code the same and it will run and then display nothing. Now, you can always open up the command prompt and then open up your exe from there. Then it will just return to the command prompt and not the OS.
                      KDevelop automatically adds that line (or something comparable to it), when it compiles. But, KDevelop does not have a Windows version, and I'm assuming you are using Windows.

                      Comment

                      • Chromer
                        Hookers and Blow
                        • Jul 2003
                        • 4981

                        #12
                        RE: Re: RE: Ok, what?

                        static public void main(String[] args);
                        {
                        system.out.println ("FFR is teh suck!);

                        Nah I'm joking. ROFL

                        Comment

                        • soccr743
                          FFR Player
                          • Dec 2003
                          • 549

                          #13
                          Re: RE: Re: RE: Ok, what?

                          Originally posted by Chromer
                          static public void main(String[] args); <--
                          {
                          system.out.println ("FFR is teh suck!);
                          <--

                          Nah I'm joking. ROFL
                          You did that wrong btw :P

                          Code:
                          public static void main&#40;String&#91;&#93; args&#41;
                          &#123;
                               system.out.println&#40;"FFR is teh suck!&#41;;
                          &#125;

                          Comment

                          • lightdarkness
                            Summer!!
                            • Jul 2003
                            • 11308

                            #14
                            Re: RE: Re: RE: Ok, what?

                            Originally posted by soccr743
                            Originally posted by Chromer
                            static public void main(String[] args); <--
                            {
                            system.out.println ("FFR is teh suck!);
                            <--

                            Nah I'm joking. ROFL
                            You did that wrong btw :P

                            Code:
                            public static void main&#40;String&#91;&#93; args&#41;
                            &#123;
                                 System.out.println&#40;"FFR is teh suck!&#41;;
                            &#125;
                            You did too...

                            Code:
                            public static void main&#40;String&#91;&#93; args&#41;
                            &#123;
                                 System.out.println&#40;"FFR is teh suck!"&#41;;
                            &#125;

                            Comment

                            • Chromer
                              Hookers and Blow
                              • Jul 2003
                              • 4981

                              #15
                              RE: Re: RE: Re: RE: Ok, what?

                              ROFL at our Syntax errors.

                              Comment

                              Working...