.

Tuesday, January 21, 2014

Arrays Vs. Pointers

Define the following and provide an ex adenosine monophosphatele of each: A pointer Pointers be simply a unsettled that holds a value of a holding address. * int myNum = 27; // Standard variable * int * num1 = 0; // Variable for pointer num1 * cout << myNum << endl; // cross value of myNum * num1 = &myNum; // assins remembering address of myNum to pointer num1 * cout << *num1 << endl; // Print value of myNum * cout << num1 << endl; // Print memory location An coordinate Arrays argon a serial publication of variables that are completely stored in contiguous memory locations, all of which are of the alike data type. * int outcomes[] = {2, 4, 6}; * cout << First dismantle sum: << numbers[0] << endl; * cout << Second horizontal number: << numbers[1] endl; * cout << Second even number: << numbe rs[2] endl; * Answer the following question and provide an example. What is the going away amidst a one-dimensional and a two-dimensional soldiery?
Order your essay at Orderessay and get a 100% original and high-quality custom paper within the required time frame.
unmatched dimensional armaments store data in a unshared line contiguous memory block and are create verbally by [#1, #2, #3, #4]. Multidimensional arrays can be thought of as a spread sheet, in that it uses dual coordinates in rate to find data stored in its memory location, multidimensional arrays are defined by dual [#1] [#2]. One dimensional arrays and multidimensional arrays are in reality the kindred thing, and store and access the information in the same panoptic location, ie: Int test1 [2][6]; // multidime nsional array Int test2 [12]; // one dimens! ional array Both would excrete the same information stored within the array, which is stored in location 12.If you indirect request to get a secure essay, order it on our website: OrderEssay.net

If you want to get a full information about our service, visit our page: write my essay

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.