From the course: C Programming Basics: Flow Control, Variables, and Pointers
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
Challenge: Create a char pointer - C Tutorial
From the course: C Programming Basics: Flow Control, Variables, and Pointers
Challenge: Create a char pointer
(intriguing music) - [Instructor] In this challenge, you flex your pointer muscles. Your task is to create a new source code file that performs five operations on three character variables, A, B, and C, and one pointer variable, P. Assign the letter A to variable A. Initialize pointer P to variable A. Assign variable B the value stored at pointer P. Initialize pointer P to variable C. assign the pointer P the letter Z. When this activity is complete, use a printf statement to display the values of variables, A, B, and C. I realize that there are a lot of steps, so you can use exercise file 05-04_challenge to help you get started. It should take you about 10 minutes to complete this challenge.
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
-
-
-
-
-
-
-
Exploring variables4m 55s
-
(Locked)
Understanding pointers4m 54s
-
(Locked)
Using pointers4m 14s
-
(Locked)
Challenge: Create a char pointer1m
-
(Locked)
Solution: Create a char pointer1m 16s
-
(Locked)
Accessing arrays with pointers6m 46s
-
(Locked)
Creating pointer functions4m 52s
-
(Locked)
Working with pointer arrays4m
-
(Locked)
Allocating memory4m 50s
-
(Locked)
Challenge: Write a Hello program28s
-
(Locked)
Solution: Write a Hello program1m 33s
-
-