Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Hello World.

Hello World.

Scheduled Pinned Locked Moved The Lounge
com
16 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    High School/Jr.High

    10 PRINT "HELLO WORLD"
    20 END

    First year in College

    program Hello(input, output)
    begin
    writeln('Hello World')
    end

    Second year in college

    (defun hello
    (print
    (cons 'Hello (list 'World))))

    New professional

    #include <stdio.h>
    void main(void)
    {
    char *message[] = {"Hello ", "World"};
    int i;

    for(i = 0; i < 2; ++i)
    printf("%s", message[i]);
    printf("\n");
    }

    Seasoned professional

    #include <iostream.h>
    #include <string.h>

    class string
    {
    private:
    int size;
    char *ptr;

    string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

    string(const string &s) : size(s.size)
    {
      ptr = new char\[size + 1\];
      strcpy(ptr, s.ptr);
    }
    
    ~string()
    {
      delete \[\] ptr;
    }
    
    friend ostream &operator <<(ostream &, const string &);
    string &operator=(const char \*);
    

    };

    ostream &operator<<(ostream &stream, const string &s)
    {
    return(stream << s.ptr);
    }

    string &string::operator=(const char *chrs)
    {
    if (this != &chrs)
    {
    delete [] ptr;
    size = strlen(chrs);
    ptr = new char[size + 1];
    strcpy(ptr, chrs);
    }
    return(*this);
    }

    int main()
    {
    string str;

    str = "Hello World";
    cout << str << endl;
    
    return(0);
    

    }

    Master programmer

    [
    uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
    ]
    library LHello
    {
    // bring in the master library
    importlib("actimp.tlb");
    importlib("actexp.tlb");

      // bring in my interfaces
      #include "pshlo.idl"
    
      \[
      uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
      \]
      cotype THello
    

    {
    interface IHello;
    interface IPersistFile;
    };
    };

    [
    exe,
    uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
    ]
    module CHelloLib
    {

      // some code related header files
      importheader(<windows.h>);
      importheader(<ole2.h>);
      importheader(<except.hxx>);
      importheader("pshlo.h");
      importheader("shlo.hxx");
      importheader("mycls.hxx");
    
      // needed typelibs
      importlib("actimp.tlb")
    
    M R K L J 9 Replies Last reply
    0
    • L Lost User

      High School/Jr.High

      10 PRINT "HELLO WORLD"
      20 END

      First year in College

      program Hello(input, output)
      begin
      writeln('Hello World')
      end

      Second year in college

      (defun hello
      (print
      (cons 'Hello (list 'World))))

      New professional

      #include <stdio.h>
      void main(void)
      {
      char *message[] = {"Hello ", "World"};
      int i;

      for(i = 0; i < 2; ++i)
      printf("%s", message[i]);
      printf("\n");
      }

      Seasoned professional

      #include <iostream.h>
      #include <string.h>

      class string
      {
      private:
      int size;
      char *ptr;

      string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

      string(const string &s) : size(s.size)
      {
        ptr = new char\[size + 1\];
        strcpy(ptr, s.ptr);
      }
      
      ~string()
      {
        delete \[\] ptr;
      }
      
      friend ostream &operator <<(ostream &, const string &);
      string &operator=(const char \*);
      

      };

      ostream &operator<<(ostream &stream, const string &s)
      {
      return(stream << s.ptr);
      }

      string &string::operator=(const char *chrs)
      {
      if (this != &chrs)
      {
      delete [] ptr;
      size = strlen(chrs);
      ptr = new char[size + 1];
      strcpy(ptr, chrs);
      }
      return(*this);
      }

      int main()
      {
      string str;

      str = "Hello World";
      cout << str << endl;
      
      return(0);
      

      }

      Master programmer

      [
      uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
      ]
      library LHello
      {
      // bring in the master library
      importlib("actimp.tlb");
      importlib("actexp.tlb");

        // bring in my interfaces
        #include "pshlo.idl"
      
        \[
        uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
        \]
        cotype THello
      

      {
      interface IHello;
      interface IPersistFile;
      };
      };

      [
      exe,
      uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
      ]
      module CHelloLib
      {

        // some code related header files
        importheader(<windows.h>);
        importheader(<ole2.h>);
        importheader(<except.hxx>);
        importheader("pshlo.h");
        importheader("shlo.hxx");
        importheader("mycls.hxx");
      
        // needed typelibs
        importlib("actimp.tlb")
      
      M Offline
      M Offline
      Michael Bergman
      wrote on last edited by
      #2

      :thumbsup:

      m.bergman

      For Bruce Schneier, quanta only have one state : afraid.

      To succeed in the world it is not enough to be stupid, you must also be well-mannered. -- Voltaire

      In most cases the only difference between disappointment and depression is your level of commitment. -- Marc Maron

      I am not a chatbot

      L 1 Reply Last reply
      0
      • L Lost User

        High School/Jr.High

        10 PRINT "HELLO WORLD"
        20 END

        First year in College

        program Hello(input, output)
        begin
        writeln('Hello World')
        end

        Second year in college

        (defun hello
        (print
        (cons 'Hello (list 'World))))

        New professional

        #include <stdio.h>
        void main(void)
        {
        char *message[] = {"Hello ", "World"};
        int i;

        for(i = 0; i < 2; ++i)
        printf("%s", message[i]);
        printf("\n");
        }

        Seasoned professional

        #include <iostream.h>
        #include <string.h>

        class string
        {
        private:
        int size;
        char *ptr;

        string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

        string(const string &s) : size(s.size)
        {
          ptr = new char\[size + 1\];
          strcpy(ptr, s.ptr);
        }
        
        ~string()
        {
          delete \[\] ptr;
        }
        
        friend ostream &operator <<(ostream &, const string &);
        string &operator=(const char \*);
        

        };

        ostream &operator<<(ostream &stream, const string &s)
        {
        return(stream << s.ptr);
        }

        string &string::operator=(const char *chrs)
        {
        if (this != &chrs)
        {
        delete [] ptr;
        size = strlen(chrs);
        ptr = new char[size + 1];
        strcpy(ptr, chrs);
        }
        return(*this);
        }

        int main()
        {
        string str;

        str = "Hello World";
        cout << str << endl;
        
        return(0);
        

        }

        Master programmer

        [
        uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
        ]
        library LHello
        {
        // bring in the master library
        importlib("actimp.tlb");
        importlib("actexp.tlb");

          // bring in my interfaces
          #include "pshlo.idl"
        
          \[
          uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
          \]
          cotype THello
        

        {
        interface IHello;
        interface IPersistFile;
        };
        };

        [
        exe,
        uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
        ]
        module CHelloLib
        {

          // some code related header files
          importheader(<windows.h>);
          importheader(<ole2.h>);
          importheader(<except.hxx>);
          importheader("pshlo.h");
          importheader("shlo.hxx");
          importheader("mycls.hxx");
        
          // needed typelibs
          importlib("actimp.tlb")
        
        R Offline
        R Offline
        Rage
        wrote on last edited by
        #3

        geekbond wrote:

        #include

        CP Professional : same as seasoned professional, but gets the < > displayed properly.

        ~RaGE();

        I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus Do not feed the troll ! - Common proverb

        1 Reply Last reply
        0
        • M Michael Bergman

          :thumbsup:

          m.bergman

          For Bruce Schneier, quanta only have one state : afraid.

          To succeed in the world it is not enough to be stupid, you must also be well-mannered. -- Voltaire

          In most cases the only difference between disappointment and depression is your level of commitment. -- Marc Maron

          I am not a chatbot

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          :)

          1 Reply Last reply
          0
          • L Lost User

            High School/Jr.High

            10 PRINT "HELLO WORLD"
            20 END

            First year in College

            program Hello(input, output)
            begin
            writeln('Hello World')
            end

            Second year in college

            (defun hello
            (print
            (cons 'Hello (list 'World))))

            New professional

            #include <stdio.h>
            void main(void)
            {
            char *message[] = {"Hello ", "World"};
            int i;

            for(i = 0; i < 2; ++i)
            printf("%s", message[i]);
            printf("\n");
            }

            Seasoned professional

            #include <iostream.h>
            #include <string.h>

            class string
            {
            private:
            int size;
            char *ptr;

            string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

            string(const string &s) : size(s.size)
            {
              ptr = new char\[size + 1\];
              strcpy(ptr, s.ptr);
            }
            
            ~string()
            {
              delete \[\] ptr;
            }
            
            friend ostream &operator <<(ostream &, const string &);
            string &operator=(const char \*);
            

            };

            ostream &operator<<(ostream &stream, const string &s)
            {
            return(stream << s.ptr);
            }

            string &string::operator=(const char *chrs)
            {
            if (this != &chrs)
            {
            delete [] ptr;
            size = strlen(chrs);
            ptr = new char[size + 1];
            strcpy(ptr, chrs);
            }
            return(*this);
            }

            int main()
            {
            string str;

            str = "Hello World";
            cout << str << endl;
            
            return(0);
            

            }

            Master programmer

            [
            uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
            ]
            library LHello
            {
            // bring in the master library
            importlib("actimp.tlb");
            importlib("actexp.tlb");

              // bring in my interfaces
              #include "pshlo.idl"
            
              \[
              uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
              \]
              cotype THello
            

            {
            interface IHello;
            interface IPersistFile;
            };
            };

            [
            exe,
            uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
            ]
            module CHelloLib
            {

              // some code related header files
              importheader(<windows.h>);
              importheader(<ole2.h>);
              importheader(<except.hxx>);
              importheader("pshlo.h");
              importheader("shlo.hxx");
              importheader("mycls.hxx");
            
              // needed typelibs
              importlib("actimp.tlb")
            
            K Offline
            K Offline
            Kenneth Haugland
            wrote on last edited by
            #5

            I see the jr. high and the new manager are at the same level in the beginning. :laugh:

            L 1 Reply Last reply
            0
            • L Lost User

              High School/Jr.High

              10 PRINT "HELLO WORLD"
              20 END

              First year in College

              program Hello(input, output)
              begin
              writeln('Hello World')
              end

              Second year in college

              (defun hello
              (print
              (cons 'Hello (list 'World))))

              New professional

              #include <stdio.h>
              void main(void)
              {
              char *message[] = {"Hello ", "World"};
              int i;

              for(i = 0; i < 2; ++i)
              printf("%s", message[i]);
              printf("\n");
              }

              Seasoned professional

              #include <iostream.h>
              #include <string.h>

              class string
              {
              private:
              int size;
              char *ptr;

              string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

              string(const string &s) : size(s.size)
              {
                ptr = new char\[size + 1\];
                strcpy(ptr, s.ptr);
              }
              
              ~string()
              {
                delete \[\] ptr;
              }
              
              friend ostream &operator <<(ostream &, const string &);
              string &operator=(const char \*);
              

              };

              ostream &operator<<(ostream &stream, const string &s)
              {
              return(stream << s.ptr);
              }

              string &string::operator=(const char *chrs)
              {
              if (this != &chrs)
              {
              delete [] ptr;
              size = strlen(chrs);
              ptr = new char[size + 1];
              strcpy(ptr, chrs);
              }
              return(*this);
              }

              int main()
              {
              string str;

              str = "Hello World";
              cout << str << endl;
              
              return(0);
              

              }

              Master programmer

              [
              uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
              ]
              library LHello
              {
              // bring in the master library
              importlib("actimp.tlb");
              importlib("actexp.tlb");

                // bring in my interfaces
                #include "pshlo.idl"
              
                \[
                uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                \]
                cotype THello
              

              {
              interface IHello;
              interface IPersistFile;
              };
              };

              [
              exe,
              uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
              ]
              module CHelloLib
              {

                // some code related header files
                importheader(<windows.h>);
                importheader(<ole2.h>);
                importheader(<except.hxx>);
                importheader("pshlo.h");
                importheader("shlo.hxx");
                importheader("mycls.hxx");
              
                // needed typelibs
                importlib("actimp.tlb")
              
              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              LOL@Seasoned Professional. The noob didn't even use a factory method.

              1 Reply Last reply
              0
              • K Kenneth Haugland

                I see the jr. high and the new manager are at the same level in the beginning. :laugh:

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Yeah. :)

                1 Reply Last reply
                0
                • L Lost User

                  High School/Jr.High

                  10 PRINT "HELLO WORLD"
                  20 END

                  First year in College

                  program Hello(input, output)
                  begin
                  writeln('Hello World')
                  end

                  Second year in college

                  (defun hello
                  (print
                  (cons 'Hello (list 'World))))

                  New professional

                  #include <stdio.h>
                  void main(void)
                  {
                  char *message[] = {"Hello ", "World"};
                  int i;

                  for(i = 0; i < 2; ++i)
                  printf("%s", message[i]);
                  printf("\n");
                  }

                  Seasoned professional

                  #include <iostream.h>
                  #include <string.h>

                  class string
                  {
                  private:
                  int size;
                  char *ptr;

                  string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

                  string(const string &s) : size(s.size)
                  {
                    ptr = new char\[size + 1\];
                    strcpy(ptr, s.ptr);
                  }
                  
                  ~string()
                  {
                    delete \[\] ptr;
                  }
                  
                  friend ostream &operator <<(ostream &, const string &);
                  string &operator=(const char \*);
                  

                  };

                  ostream &operator<<(ostream &stream, const string &s)
                  {
                  return(stream << s.ptr);
                  }

                  string &string::operator=(const char *chrs)
                  {
                  if (this != &chrs)
                  {
                  delete [] ptr;
                  size = strlen(chrs);
                  ptr = new char[size + 1];
                  strcpy(ptr, chrs);
                  }
                  return(*this);
                  }

                  int main()
                  {
                  string str;

                  str = "Hello World";
                  cout << str << endl;
                  
                  return(0);
                  

                  }

                  Master programmer

                  [
                  uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
                  ]
                  library LHello
                  {
                  // bring in the master library
                  importlib("actimp.tlb");
                  importlib("actexp.tlb");

                    // bring in my interfaces
                    #include "pshlo.idl"
                  
                    \[
                    uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                    \]
                    cotype THello
                  

                  {
                  interface IHello;
                  interface IPersistFile;
                  };
                  };

                  [
                  exe,
                  uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
                  ]
                  module CHelloLib
                  {

                    // some code related header files
                    importheader(<windows.h>);
                    importheader(<ole2.h>);
                    importheader(<except.hxx>);
                    importheader("pshlo.h");
                    importheader("shlo.hxx");
                    importheader("mycls.hxx");
                  
                    // needed typelibs
                    importlib("actimp.tlb")
                  
                  J Offline
                  J Offline
                  Jorgen Andersson
                  wrote on last edited by
                  #8

                  A manager using a command line mail program. :wtf: I think that's a hint on how old the joke is.

                  Light moves faster than sound. That is why some people appear bright, until you hear them speak. List of common misconceptions

                  1 Reply Last reply
                  0
                  • L Lost User

                    High School/Jr.High

                    10 PRINT "HELLO WORLD"
                    20 END

                    First year in College

                    program Hello(input, output)
                    begin
                    writeln('Hello World')
                    end

                    Second year in college

                    (defun hello
                    (print
                    (cons 'Hello (list 'World))))

                    New professional

                    #include <stdio.h>
                    void main(void)
                    {
                    char *message[] = {"Hello ", "World"};
                    int i;

                    for(i = 0; i < 2; ++i)
                    printf("%s", message[i]);
                    printf("\n");
                    }

                    Seasoned professional

                    #include <iostream.h>
                    #include <string.h>

                    class string
                    {
                    private:
                    int size;
                    char *ptr;

                    string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

                    string(const string &s) : size(s.size)
                    {
                      ptr = new char\[size + 1\];
                      strcpy(ptr, s.ptr);
                    }
                    
                    ~string()
                    {
                      delete \[\] ptr;
                    }
                    
                    friend ostream &operator <<(ostream &, const string &);
                    string &operator=(const char \*);
                    

                    };

                    ostream &operator<<(ostream &stream, const string &s)
                    {
                    return(stream << s.ptr);
                    }

                    string &string::operator=(const char *chrs)
                    {
                    if (this != &chrs)
                    {
                    delete [] ptr;
                    size = strlen(chrs);
                    ptr = new char[size + 1];
                    strcpy(ptr, chrs);
                    }
                    return(*this);
                    }

                    int main()
                    {
                    string str;

                    str = "Hello World";
                    cout << str << endl;
                    
                    return(0);
                    

                    }

                    Master programmer

                    [
                    uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
                    ]
                    library LHello
                    {
                    // bring in the master library
                    importlib("actimp.tlb");
                    importlib("actexp.tlb");

                      // bring in my interfaces
                      #include "pshlo.idl"
                    
                      \[
                      uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                      \]
                      cotype THello
                    

                    {
                    interface IHello;
                    interface IPersistFile;
                    };
                    };

                    [
                    exe,
                    uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
                    ]
                    module CHelloLib
                    {

                      // some code related header files
                      importheader(<windows.h>);
                      importheader(<ole2.h>);
                      importheader(<except.hxx>);
                      importheader("pshlo.h");
                      importheader("shlo.hxx");
                      importheader("mycls.hxx");
                    
                      // needed typelibs
                      importlib("actimp.tlb")
                    
                    Steve EcholsS Offline
                    Steve EcholsS Offline
                    Steve Echols
                    wrote on last edited by
                    #9

                    Kindergartner C:\>echo Hello, World. :)


                    - S 50 cups of coffee and you know it's on! Code, follow, or get out of the way.

                    • S
                      50 cups of coffee and you know it's on!
                      Code, follow, or get out of the way.
                    L 1 Reply Last reply
                    0
                    • L Lost User

                      High School/Jr.High

                      10 PRINT "HELLO WORLD"
                      20 END

                      First year in College

                      program Hello(input, output)
                      begin
                      writeln('Hello World')
                      end

                      Second year in college

                      (defun hello
                      (print
                      (cons 'Hello (list 'World))))

                      New professional

                      #include <stdio.h>
                      void main(void)
                      {
                      char *message[] = {"Hello ", "World"};
                      int i;

                      for(i = 0; i < 2; ++i)
                      printf("%s", message[i]);
                      printf("\n");
                      }

                      Seasoned professional

                      #include <iostream.h>
                      #include <string.h>

                      class string
                      {
                      private:
                      int size;
                      char *ptr;

                      string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

                      string(const string &s) : size(s.size)
                      {
                        ptr = new char\[size + 1\];
                        strcpy(ptr, s.ptr);
                      }
                      
                      ~string()
                      {
                        delete \[\] ptr;
                      }
                      
                      friend ostream &operator <<(ostream &, const string &);
                      string &operator=(const char \*);
                      

                      };

                      ostream &operator<<(ostream &stream, const string &s)
                      {
                      return(stream << s.ptr);
                      }

                      string &string::operator=(const char *chrs)
                      {
                      if (this != &chrs)
                      {
                      delete [] ptr;
                      size = strlen(chrs);
                      ptr = new char[size + 1];
                      strcpy(ptr, chrs);
                      }
                      return(*this);
                      }

                      int main()
                      {
                      string str;

                      str = "Hello World";
                      cout << str << endl;
                      
                      return(0);
                      

                      }

                      Master programmer

                      [
                      uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
                      ]
                      library LHello
                      {
                      // bring in the master library
                      importlib("actimp.tlb");
                      importlib("actexp.tlb");

                        // bring in my interfaces
                        #include "pshlo.idl"
                      
                        \[
                        uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                        \]
                        cotype THello
                      

                      {
                      interface IHello;
                      interface IPersistFile;
                      };
                      };

                      [
                      exe,
                      uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
                      ]
                      module CHelloLib
                      {

                        // some code related header files
                        importheader(<windows.h>);
                        importheader(<ole2.h>);
                        importheader(<except.hxx>);
                        importheader("pshlo.h");
                        importheader("shlo.hxx");
                        importheader("mycls.hxx");
                      
                        // needed typelibs
                        importlib("actimp.tlb")
                      
                      M Offline
                      M Offline
                      Marc Clifton
                      wrote on last edited by
                      #10

                      You say "Goodbye" and I say "Hello, hello, hello". I don't know why you say "Goodbye", I say "Hello, hello, hello". I don't know why you say goodbye, I say hello. :) Marc

                      Reverse Engineering Legacy Applications
                      How To Think Like a Functional Programmer
                      My Blog
                      Computational Types in C# and F#

                      L 1 Reply Last reply
                      0
                      • M Marc Clifton

                        You say "Goodbye" and I say "Hello, hello, hello". I don't know why you say "Goodbye", I say "Hello, hello, hello". I don't know why you say goodbye, I say hello. :) Marc

                        Reverse Engineering Legacy Applications
                        How To Think Like a Functional Programmer
                        My Blog
                        Computational Types in C# and F#

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        It would be nice to read a thread in this forum without having you throw in a reference to the Beatles. :wtf:

                        M 1 Reply Last reply
                        0
                        • L Lost User

                          High School/Jr.High

                          10 PRINT "HELLO WORLD"
                          20 END

                          First year in College

                          program Hello(input, output)
                          begin
                          writeln('Hello World')
                          end

                          Second year in college

                          (defun hello
                          (print
                          (cons 'Hello (list 'World))))

                          New professional

                          #include <stdio.h>
                          void main(void)
                          {
                          char *message[] = {"Hello ", "World"};
                          int i;

                          for(i = 0; i < 2; ++i)
                          printf("%s", message[i]);
                          printf("\n");
                          }

                          Seasoned professional

                          #include <iostream.h>
                          #include <string.h>

                          class string
                          {
                          private:
                          int size;
                          char *ptr;

                          string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

                          string(const string &s) : size(s.size)
                          {
                            ptr = new char\[size + 1\];
                            strcpy(ptr, s.ptr);
                          }
                          
                          ~string()
                          {
                            delete \[\] ptr;
                          }
                          
                          friend ostream &operator <<(ostream &, const string &);
                          string &operator=(const char \*);
                          

                          };

                          ostream &operator<<(ostream &stream, const string &s)
                          {
                          return(stream << s.ptr);
                          }

                          string &string::operator=(const char *chrs)
                          {
                          if (this != &chrs)
                          {
                          delete [] ptr;
                          size = strlen(chrs);
                          ptr = new char[size + 1];
                          strcpy(ptr, chrs);
                          }
                          return(*this);
                          }

                          int main()
                          {
                          string str;

                          str = "Hello World";
                          cout << str << endl;
                          
                          return(0);
                          

                          }

                          Master programmer

                          [
                          uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
                          ]
                          library LHello
                          {
                          // bring in the master library
                          importlib("actimp.tlb");
                          importlib("actexp.tlb");

                            // bring in my interfaces
                            #include "pshlo.idl"
                          
                            \[
                            uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                            \]
                            cotype THello
                          

                          {
                          interface IHello;
                          interface IPersistFile;
                          };
                          };

                          [
                          exe,
                          uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
                          ]
                          module CHelloLib
                          {

                            // some code related header files
                            importheader(<windows.h>);
                            importheader(<ole2.h>);
                            importheader(<except.hxx>);
                            importheader("pshlo.h");
                            importheader("shlo.hxx");
                            importheader("mycls.hxx");
                          
                            // needed typelibs
                            importlib("actimp.tlb")
                          
                          J Offline
                          J Offline
                          jsc42
                          wrote on last edited by
                          #12

                          It's 12 years since I've seen this and it has only been slightly modified in all of that time. Of course, real programmers write in FORTRAN IV:

                          C HELLO, WORLD! PROGRAMME IN FORTRAN IV
                          C
                          C DECLARE TEXT
                          C
                          INTEGER*4 HELLOW(4)
                          DATA HELLOW / 4HHELL, 4HO, W, 4HORLD, 4H! /
                          C
                          C OUTPUT TEXT
                          C
                          WRITE (6, 10) (HELLOW(I), I = 1, 4)
                          10 FORMAT (1H , 4(A4))
                          C
                          C FINISHED
                          C
                          STOP
                          END

                          1 Reply Last reply
                          0
                          • L Lost User

                            It would be nice to read a thread in this forum without having you throw in a reference to the Beatles. :wtf:

                            M Offline
                            M Offline
                            Marc Clifton
                            wrote on last edited by
                            #13

                            MehGerbil wrote:

                            It would be nice to read a thread in this forum without having you throw in a reference to the Beatles.

                            Well, all I have to say to that is.... LET IT BE! ;P Marc

                            Reverse Engineering Legacy Applications
                            How To Think Like a Functional Programmer
                            My Blog
                            Computational Types in C# and F#

                            1 Reply Last reply
                            0
                            • L Lost User

                              High School/Jr.High

                              10 PRINT "HELLO WORLD"
                              20 END

                              First year in College

                              program Hello(input, output)
                              begin
                              writeln('Hello World')
                              end

                              Second year in college

                              (defun hello
                              (print
                              (cons 'Hello (list 'World))))

                              New professional

                              #include <stdio.h>
                              void main(void)
                              {
                              char *message[] = {"Hello ", "World"};
                              int i;

                              for(i = 0; i < 2; ++i)
                              printf("%s", message[i]);
                              printf("\n");
                              }

                              Seasoned professional

                              #include <iostream.h>
                              #include <string.h>

                              class string
                              {
                              private:
                              int size;
                              char *ptr;

                              string() : size(0), ptr(new char[1]) { ptr[0] = 0; }

                              string(const string &s) : size(s.size)
                              {
                                ptr = new char\[size + 1\];
                                strcpy(ptr, s.ptr);
                              }
                              
                              ~string()
                              {
                                delete \[\] ptr;
                              }
                              
                              friend ostream &operator <<(ostream &, const string &);
                              string &operator=(const char \*);
                              

                              };

                              ostream &operator<<(ostream &stream, const string &s)
                              {
                              return(stream << s.ptr);
                              }

                              string &string::operator=(const char *chrs)
                              {
                              if (this != &chrs)
                              {
                              delete [] ptr;
                              size = strlen(chrs);
                              ptr = new char[size + 1];
                              strcpy(ptr, chrs);
                              }
                              return(*this);
                              }

                              int main()
                              {
                              string str;

                              str = "Hello World";
                              cout << str << endl;
                              
                              return(0);
                              

                              }

                              Master programmer

                              [
                              uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
                              ]
                              library LHello
                              {
                              // bring in the master library
                              importlib("actimp.tlb");
                              importlib("actexp.tlb");

                                // bring in my interfaces
                                #include "pshlo.idl"
                              
                                \[
                                uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
                                \]
                                cotype THello
                              

                              {
                              interface IHello;
                              interface IPersistFile;
                              };
                              };

                              [
                              exe,
                              uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
                              ]
                              module CHelloLib
                              {

                                // some code related header files
                                importheader(<windows.h>);
                                importheader(<ole2.h>);
                                importheader(<except.hxx>);
                                importheader("pshlo.h");
                                importheader("shlo.hxx");
                                importheader("mycls.hxx");
                              
                                // needed typelibs
                                importlib("actimp.tlb")
                              
                              S Offline
                              S Offline
                              shiprat
                              wrote on last edited by
                              #14

                              APL hacker

                              "Hello, world", "!"

                              D 1 Reply Last reply
                              0
                              • S shiprat

                                APL hacker

                                "Hello, world", "!"

                                D Offline
                                D Offline
                                Djibril
                                wrote on last edited by
                                #15

                                By the time you are writing this, $this sees who pays for the persistance... I love logging my boss. ... I am TIME, DAMN, you know when you possess your interrupts!

                                Where there is a WISH, there is a WILL.

                                1 Reply Last reply
                                0
                                • Steve EcholsS Steve Echols

                                  Kindergartner C:\>echo Hello, World. :)


                                  - S 50 cups of coffee and you know it's on! Code, follow, or get out of the way.

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #16

                                  Lol. :)

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups