Arrays, Strings, & Pointers - University of Arkansas
嚜澤rrays, Strings, & Pointers
Alexander Nelson
September 9, 2019
University of Arkansas - Department of Computer Science and Computer Engineering
Arrays, Strings, & Pointers
Arrays, Strings, & Pointers are all connected in C
? Pointer 每 Variable storing a memory location
? Array 每 Block of memory storing associated variables
Array identifier is a pointer to location of first element
? String 每 Array of character variables
1
Example
#include
int main(){
char* myString1 = "Hello!\n";
char myString2[] = "Hello!\n";
printf("%s",myString1);
printf("%s",myString2);
return 0;
}
myString1 and myString2 are equivalent statements!
2
Pointers
Pointers
Pointer 每 Variable that points to a memory location
Requires:
? Name 每 Name of the pointer variable
? Type 每 Type of the variable that is being addressed, with
appended asterisk
e.g. int* myPointer;
Variable size in memory is not based on type, but on memory size
? Why?
3
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- university of minnesota college of education
- university of minnesota school of social work
- map of arkansas school districts
- state of arkansas teacher license
- free state of arkansas forms
- state of arkansas court cases
- the state of arkansas website
- list of arkansas state agencies
- gov of arkansas list
- state of arkansas poverty level
- state of arkansas information
- state of arkansas license search