Thread: Jumping into C++

  1. #1
    Registered User
    Join Date
    Mar 2019
    Posts
    4

    Jumping into C++

    Looking for help/solutions to practice problems that I get stuck on.
    Anyone out there?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You could always post the practice problem, your attempted solution, and what difficulties you faced.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Mar 2019
    Posts
    4
    Thanks. Just tried that. The link is dead.
    The following errors occurred with your submission


    1. Please use code tags: insert
      Code:
       before your 				source code and
      after it in order to post. See Posting Code - Read this First for more information.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    It's telling you to put [code][/code] tags around your code.

    So your post looks like this.
    Code:
    int main ( ) {
        printf("Hello world\n");
    }
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Mar 2019
    Posts
    4
    Code:
     
    void insertion_sort (int size)                                                 // A function, int or void?, that allows the array size to be variable. int array[ ]
    {
                                                                                                    // Tried this---> int array[ number ];
            cout << "Input desired array size: """;                         // Trying to have the user input the array size at the beginning.
            cin >> size;                                                                    // Tried this---> cin >> array[number];
    }

  6. #6
    Registered User
    Join Date
    Mar 2019
    Posts
    1
    Vectors are used in situations where size of the array cannot be predetermined. They come with a bunch of handful functions along with them and have been a part of c++ since '98 compilers at least.

  7. #7
    Registered User
    Join Date
    Mar 2019
    Posts
    4
    Thanks. I'm going to look into vectors.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. jumping into c++ ch 11
    By jvar707 in forum C++ Programming
    Replies: 3
    Last Post: 08-28-2015, 12:30 AM
  2. Jumping into c++ help
    By Krunchee in forum C++ Programming
    Replies: 3
    Last Post: 08-03-2013, 10:37 PM
  3. after 'jumping to c++'
    By nish1013 in forum C++ Programming
    Replies: 2
    Last Post: 07-09-2013, 08:26 AM
  4. Jumping into C++
    By Tamim Ad Dari in forum C++ Programming
    Replies: 4
    Last Post: 01-12-2013, 08:29 PM
  5. Jumping into C++
    By Tamim Ad Dari in forum C++ Programming
    Replies: 9
    Last Post: 01-11-2013, 09:45 AM

Tags for this Thread