From the course: C Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Exploring unary operators - C Tutorial
From the course: C Essential Training
Exploring unary operators
- [Instructor] C language Unary Operators affect only one variable. The name Unary comes from the Latin onus one. And here's the full list of operators, including the size of operator, which is both an operator and the C-language keyword, it deserves a bit of exploration size of works on a variable array or chunk of memory. It returns a size_t value, which is an unsigned positive integer representing the number of bytes of memory the item occupies. To use the size_t type death. You must include the stdio.h header file in your code. This operator is used most often when allocating memory or dealing with pointers. In this code, six variables are declared the four standard character, integer, float and double. I'm also added a string or character array and a buffer capable of storing 10 integers. For each of these items a printf statement, uses the size of operator, to output how many bytes each item occupies in…
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
-
-
-
-
-
Working with math operators3m 3s
-
(Locked)
Challenge: Do some math49s
-
(Locked)
Solution: Do some math1m 29s
-
(Locked)
Using assignment operators1m 44s
-
(Locked)
Obeying the order of precedence3m 13s
-
(Locked)
Challenge: Get the order correct54s
-
(Locked)
Solution: Get the order correct1m 11s
-
(Locked)
Working with relational operators3m 39s
-
(Locked)
Using logical operators3m 49s
-
(Locked)
Understanding bitwise operators3m 36s
-
(Locked)
Shifting bits3m 18s
-
(Locked)
Exploring unary operators3m 44s
-
(Locked)
Challenge: Binary math1m 5s
-
(Locked)
Solution: Binary math2m 11s
-
-
-
-