Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ print array of arrays with pointer

// C++ Program to insert and display data entered by using pointer notation.

#include <iostream>
using namespace std;

int main() {
    float arr[5];
    
   // Insert data using pointer notation
    cout << "Enter 5 numbers: ";
    for (int i = 0; i < 5; ++i) {

        // store input number in arr[i]
        cin >> *(arr + i) ;

    }

    // Display data using pointer notation
    cout << "Displaying data: " << endl;
    for (int i = 0; i < 5; ++i) {

        // display value of arr[i]
        cout << *(arr + i) << endl ;

    }

    return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: unordered_map c++ 
Cpp :: Start mongodb community server 
Cpp :: get function in cpp. 
Cpp :: evennumbers 1 to 100 
Cpp :: copy assignment operator in c++ 
Cpp :: runtime 
Cpp :: oop in c++ have 5 
Cpp :: memset in cpp 
Cpp :: c++ string concatenation 
Cpp :: remove linked list elements leetcode 
Cpp :: c language all keywords in string 
Cpp :: c++ check first character of string 
Cpp :: declare class c++ 
Cpp :: define a type in c++ 
Cpp :: activity selection problem 
Cpp :: auto in cpp 
Cpp :: Initialize Vector Iterator with end() function 
Cpp :: c++ include difference between quotes and brackets 
Cpp :: even or odd program in c++ 
Cpp :: creating large maps cpp 
Cpp :: return multiple values c++ 
Cpp :: find n unique integers sum up to zero 
Cpp :: what is xor_eq c++ 
Cpp :: function and function prototype. 
Cpp :: c++ text between substrings 
Cpp :: passing reference to thread c++ 
Cpp :: c++ vector allocator example 
Cpp :: cin une énumération 
Cpp :: move letter position using c++ with input 
Cpp :: statement that causes a function to end in c++ 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =