From the course: Advanced C Programming: Optimize Performance and Efficiency
Unlock the full course today
Join today to access over 24,500 courses taught by industry experts.
How to bind the asterisk operator - C Tutorial
From the course: Advanced C Programming: Optimize Performance and Efficiency
How to bind the asterisk operator
- [Instructor] The two operators associated with pointers in the C language are the ampersand and the asterisk. Of the two, the asterisks can be the most confusing. The ampersand was covered in another movie. Our topic here is the asterisk. The unary asterisk operator underscores the split personality of the C language pointer. Yes, it's part of the confusion. The operator is used to declare a pointer variable but after that, it may or may not appear next to the pointer variable name. When the asterisk is used, the pointer references the value at the location. Here, pointer variables a and b are used as values. When the asterisk is absent, the pointer refers to a memory location. Here, pointer variables a and b are used as memory locations. The problem comes when you try to manipulate a pointer. Does the asterisk bind to the variable tighter than the increment operator, or to put it another way, does this operation…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
When to use the ampersand operator4m 20s
-
(Locked)
How to bind the asterisk operator4m 51s
-
(Locked)
Challenge: Incrementing a pointer23s
-
(Locked)
Solution: Incrementing a pointer1m 10s
-
(Locked)
Understanding arrays and pointers4m 4s
-
(Locked)
Challenge: Displaying an array29s
-
(Locked)
Solution: Displaying an array54s
-
(Locked)
Obeying the order of precedence6m 27s
-
(Locked)
-