Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

Accessing C++ Array Elements

#include <iostream>
using namespace std;

int main()
{
	int arr[4];
	arr[0] = 2;
	arr[2] = -5;

	arr[3/2] = 1;
	arr[3] = arr[0];

	cout << arr[0] << " " << arr[1] << " " << arr[2] << " "
		<< arr[3];

	return 0;
}
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Accessing #Array #Elements
ADD COMMENT
Topic
Name
4+6 =