Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: c++ programming  (Read 3340 times)

0 Members and 1 Guest are viewing this topic.

Chrisantus Eze

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Windows 8
    c++ programming
    « on: October 25, 2016, 06:21:00 PM »
    Please am facing challenges with two dimensional arrays, especially passing it as an argument to a function. I'll need your help guys.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: c++ programming
    « Reply #1 on: October 25, 2016, 07:04:51 PM »
    Quote
    And a two-dimensional array looks like this: int[][] myArray = { {0,1,2,3}, {3,2,1,0}, {3,5,6,1}, {3,8,3,4} }; For our purposes, it is better to think of the two-dimensional array as a matrix. A matrix can be thought of as a grid of numbers, arranged in rows and columns, kind of like a bingo board.
    https://processing.org/tutorials/2darray/
    Which version of C++ ?
    If Visual Studio Express - C++  there are lots oof free tutorials.
    Fir a specific answer, look here:
    http://stackoverflow.com/questions/9446707/correct-way-of-passing-2-dimensional-array-into-a-function
    Quote
    You are doing in wrong way. You can pass 2-d array with the help of pointer to an array, or simply pass an array or through Single pointer.
    8)

    Chrisantus Eze

      Topic Starter


      Newbie

      • Experience: Beginner
      • OS: Windows 8
      Re: c++ programming
      « Reply #2 on: October 26, 2016, 03:55:34 AM »
      I worked on a program that will accept the high and low temperatures of the month of the year, and the output the average high and low temperatures and also the index of the highest of the high temperatures and also the index of the lowest of the low temperatures. But it refused to run, code blocks instead alerted me of the wrong use of the "operator << std::". Please can you help me with ideas of what to do or to give me a working program to achieve that. Please your help will be appreciated.