c_language_pointers

C Language Pointers

Return to C Language, Recursion, Pointers, C Language Memory Management, C Language Bibliography

See:

Snippet from Wikipedia: Pointer (computer programming)

In computer science, a pointer is an object in many programming languages that stores a memory address. This can be that of another value located in computer memory, or in some cases, that of memory-mapped computer hardware. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer. As an analogy, a page number in a book's index could be considered a pointer to the corresponding page; dereferencing such a pointer would be done by flipping to the page with the given page number and reading the text found on that page. The actual format and content of a pointer variable is dependent on the underlying computer architecture.

Using pointers significantly improves performance for repetitive operations, like traversing iterable data structures (e.g. strings, lookup tables, control tables, linked lists, and tree structures). In particular, it is often much cheaper in time and space to copy and dereference pointers than it is to copy and access the data to which the pointers point.

Pointers are also used to hold the addresses of entry points for called subroutines in procedural programming and for run-time linking to dynamic link libraries (DLLs). In object-oriented programming, pointers to functions are used for binding methods, often using virtual method tables.

A pointer is a simple, more concrete implementation of the more abstract reference data type. Several languages, especially low-level languages, support some type of pointer, although some have more restrictions on their use than others. While "pointer" has been used to refer to references in general, it more properly applies to data structures whose interface explicitly allows the pointer to be manipulated (arithmetically via pointer arithmetic) as a memory address, as opposed to a magic cookie or capability which does not allow such. Because pointers allow both protected and unprotected access to memory addresses, there are risks associated with using them, particularly in the latter case. Primitive pointers are often stored in a format similar to an integer; however, attempting to dereference or "look up" such a pointer whose value is not a valid memory address could cause a program to crash (or contain invalid data). To alleviate this potential problem, as a matter of type safety, pointers are considered a separate type parameterized by the type of data they point to, even if the underlying representation is an integer. Other measures may also be taken (such as validation and bounds checking), to verify that the pointer variable contains a value that is both a valid memory address and within the numerical range that the processor is capable of addressing.

C Language Vocabulary List (Sorted by Popularity)

C Language Programming Language, C Language Compiler, C Language Preprocessor, C Language Linker, C Language Standard, C Language ANSI C, C Language ISO C, C Language C89, C Language C90, C Language C99, C Language C11, C Language C17, C Language C18, C Language C23, C Language K&R Style, C Language Translation Unit, C Language Object File, C Language Header File, C Language Source File, C Language Macro, C Language Macro Expansion, C Language Conditional Compilation, include Directive, define Directive, if Directive, ifdef Directive, ifndef Directive, else Directive, elif Directive, endif Directive, undef Directive, line Directive, error Directive, pragma Directive, C Language Pragma once, C Language Inline Keyword, C Language Extern Keyword, C Language Static Keyword, C Language Const Keyword, C Language Volatile Keyword, C Language Restrict Keyword, C Language _Thread_local Keyword, C Language _Atomic Keyword, C Language _Noreturn Keyword, C Language _Static_assert Keyword, C Language _Alignas Keyword, C Language _Alignof Keyword, C Language _Generic Keyword, C Language _Bool Type, C Language _Complex Type, C Language _Imaginary Type, C Language Signed Keyword, C Language Unsigned Keyword, C Language Long Keyword, C Language Short Keyword, C Language Char Type, C Language Int Type, C Language Float Type, C Language Double Type, C Language Long Double Type, C Language Void Type, C Language Enum Keyword, C Language Struct Keyword, C Language Union Keyword, C Language typedef Keyword, C Language auto Keyword, C Language register Keyword, C Language Return Statement, C Language If Statement, C Language Else Statement, C Language Switch Statement, C Language Case Label, C Language Default Label, C Language For Loop, C Language While Loop, C Language Do While Loop, C Language Break Statement, C Language Continue Statement, C Language Goto Statement, C Language Label, C Language Compound Statement, C Language Block Scope, C Language File Scope, C Language Function Scope, C Language Prototype Scope, C Language Pointer Type, C Language Array Type, C Language Function Type, C Language Lvalue, C Language Rvalue, C Language Assignment Operator, C Language Arithmetic Operator, C Language Logical Operator, C Language Bitwise Operator, C Language Comparison Operator, C Language Increment Operator, C Language Decrement Operator, C Language Ternary Operator, C Language Sizeof Operator, C Language Comma Operator, C Language Type Cast, C Language Escape Sequence, C Language String Literal, C Language Character Constant, C Language Integer Constant, C Language Floating Constant, C Language Enumeration Constant, C Language Hexadecimal Constant, C Language Octal Constant, C Language UCN (Universal Character Name), C Language Wide Character Literal, C Language Wide String Literal, C Language Compound Literal, C Language Designated Initializer, C Language Flexible Array Member, C Language Variadic Function, C Language Ellipsis (...), C Language va_list Type, C Language va_start Macro, C Language va_arg Macro, C Language va_end Macro, C Language va_copy Macro, C Language setjmp Macro, C Language longjmp Function, C Language jmp_buf Type, C Language signal Handling, C Language raise Function, C Language SIG_DFL Macro, C Language SIG_IGN Macro, C Language SIG_ERR Macro, C Language <stdio.h> Header, C Language <stdlib.h> Header, C Language <string.h> Header, C Language <math.h> Header, C Language <stdbool.h> Header, C Language <stddef.h> Header, C Language <stdint.h> Header, C Language <inttypes.h> Header, C Language <ctype.h> Header, C Language <locale.h> Header, C Language <time.h> Header, C Language <assert.h> Header, C Language <signal.h> Header, C Language <setjmp.h> Header, C Language <stdarg.h> Header, C Language <fenv.h> Header, C Language <float.h> Header, C Language <complex.h> Header, C Language <tgmath.h> Header, C Language <stdalign.h> Header, C Language <stdatomic.h> Header, C Language <stdnoreturn.h> Header, C Language <threads.h> Header, C Language <uchar.h> Header, C Language I/O Stream, C Language FILE Type, C Language fpos_t Type, C Language off_t Type, C Language size_t Type, C Language ptrdiff_t Type, C Language wchar_t Type, C Language wint_t Type, C Language mbstate_t Type, C Language clock_t Type, C Language time_t Type, C Language struct tm, C Language errno Macro, C Language EDOM Macro, C Language ERANGE Macro, C Language EOF Macro, C Language NULL Pointer, C Language offsetof Macro, C Language assert Macro, C Language static_assert Keyword, C Language inline function, C Language restrict qualifier, C Language volatile qualifier, C Language atomic types, C Language atomic_flag Type, C Language atomic_bool, C Language atomic_thread_fence, C Language atomic_signal_fence, C Language memory_order, C Language memory_order_relaxed, C Language memory_order_acquire, C Language memory_order_release, C Language memory_order_acq_rel, C Language memory_order_seq_cst, C Language Alignment, C Language Alignment Requirement, C Language _Alignof Operator, C Language _Alignas Specifier, C Language Thread-Safety, C Language Thread Creation, C Language Thread Termination, C Language thrd_t Type, C Language thrd_create Function, C Language thrd_join Function, C Language thrd_exit Function, C Language thrd_sleep Function, C Language mtx_t Type, C Language mtx_init Function, C Language mtx_lock Function, C Language mtx_trylock Function, C Language mtx_unlock Function, C Language mtx_destroy Function, C Language cnd_t Type, C Language cnd_init Function, C Language cnd_signal Function, C Language cnd_broadcast Function, C Language cnd_wait Function, C Language cnd_timedwait Function, C Language cnd_destroy Function, C Language tss_t Type, C Language tss_create Function, C Language tss_delete Function, C Language tss_set Function, C Language tss_get Function, C Language call_once Function, C Language once_flag Type, C Language C Preprocessing, C Language Tokenization, C Language Trigraph, C Language Digraph, C Language Universal Character Names, C Language Escape Sequences, C Language Wide Character, C Language Execution Character Set, C Language Source Character Set, C Language String Concatenation, C Language Translation Phases, C Language Undefined Behavior, C Language Implementation-Defined Behavior, C Language Unspecified Behavior, C Language Sequence Point, C Language Sequenced Before, C Language Sequenced After, C Language Unsequenced, C Language Scalar Type, C Language Aggregate Type, C Language POD (Plain Old Data), C Language Object Lifetime, C Language Storage Duration, C Language Static Storage Duration, C Language Thread Storage Duration, C Language Automatic Storage Duration, C Language Allocated Storage Duration, C Language Allocation Functions, C Language malloc Function, C Language calloc Function, C Language realloc Function, C Language free Function, C Language aligned_alloc Function, C Language abort Function, C Language atexit Function, C Language at_quick_exit Function, C Language quick_exit Function, C Language exit Function, C Language getenv Function, C Language system Function, C Language bsearch Function, C Language qsort Function, C Language abs Function, C Language labs Function, C Language llabs Function, C Language div Function, C Language ldiv Function, C Language lldiv Function, C Language rand Function, C Language srand Function, C Language atof Function, C Language atoi Function, C Language atol Function, C Language atoll Function, C Language strtod Function, C Language strtof Function, C Language strtold Function, C Language strtol Function, C Language strtoul Function, C Language strtoll Function, C Language strtoull Function, C Language mblen Function, C Language mbtowc Function, C Language wctomb Function, C Language mbstowcs Function, C Language wcstombs Function, C Language memset Function, C Language memcpy Function, C Language memmove Function, C Language memcmp Function, C Language memchr Function, C Language strcpy Function, C Language strncpy Function, C Language strcat Function, C Language strncat Function, C Language strcmp Function, C Language strncmp Function, C Language strchr Function, C Language strrchr Function, C Language strstr Function, C Language strspn Function, C Language strcspn Function, C Language strlen Function, C Language strerror Function, C Language strtok Function, C Language strcoll Function, C Language strxfrm Function, C Language sprintf Function, C Language fprintf Function, C Language printf Function, C Language scanf Function, C Language fscanf Function, C Language sscanf Function, C Language vprintf Function, C Language vfprintf Function, C Language vsprintf Function, C Language vsnprintf Function, C Language fgetc Function, C Language fgets Function, C Language fputc Function, C Language fputs Function, C Language getchar Function, C Language putchar Function, C Language puts Function, C Language ungetc Function, C Language fread Function, C Language fwrite Function, C Language fseek Function, C Language ftell Function, C Language rewind Function, C Language fgetpos Function, C Language fsetpos Function, C Language feof Function, C Language ferror Function, C Language clearerr Function, C Language fflush Function, C Language fopen Function, C Language freopen Function, C Language fclose Function, C Language remove Function, C Language rename Function, C Language tmpfile Function, C Language tmpnam Function, C Language setbuf Function, C Language setvbuf Function, C Language perror Function, C Language fwide Function, C Language wprintf Function, C Language fwprintf Function, C Language swprintf Function, C Language wscanf Function, C Language fwscanf Function, C Language swscanf Function, C Language towlower Function, C Language towupper Function, C Language iswalpha Function, C Language iswcntrl Function, C Language iswdigit Function, C Language iswlower Function, C Language iswgraph Function, C Language iswprint Function, C Language iswpunct Function, C Language iswspace Function, C Language iswupper Function, C Language iswxdigit Function, C Language wcslen Function, C Language wcsnlen Function, C Language wcscmp Function, C Language wcsncmp Function, C Language wcscpy Function, C Language wcsncpy Function, C Language wcscat Function, C Language wcsncat Function, C Language wcschr Function, C Language wcsrchr Function, C Language wcsstr Function, C Language wcspbrk Function, C Language wcsspn Function, C Language wcscspn Function, C Language wcstok Function, C Language wmemset Function, C Language wmemcpy Function, C Language wmemmove Function, C Language wmemcmp Function, C Language wmemchr Function, C Language wcscoll Function, C Language wcsxfrm Function, C Language wcsftime Function, C Language mktime Function, C Language difftime Function, C Language ctime Function, C Language gmtime Function, C Language localtime Function, C Language strftime Function, C Language clock Function, C Language CLOCKS_PER_SEC Macro, C Language FLT_EVAL_METHOD Macro, C Language FLT_ROUNDS Macro, C Language FLT_DIG Macro, C Language DBL_DIG Macro, C Language LDBL_DIG Macro, C Language FLT_RADIX Macro, C Language FLT_MANT_DIG Macro, C Language DBL_MANT_DIG Macro, C Language LDBL_MANT_DIG Macro, C Language FLT_EPSILON Macro, C Language DBL_EPSILON Macro, C Language LDBL_EPSILON Macro, C Language FLT_MAX Macro, C Language DBL_MAX Macro, C Language LDBL_MAX Macro, C Language FLT_MIN Macro, C Language DBL_MIN Macro, C Language LDBL_MIN Macro, C Language HUGE_VAL Macro, C Language HUGE_VALF Macro, C Language HUGE_VALL Macro, C Language INFINITY Macro, C Language NAN Macro, C Language FP_INFINITE Macro, C Language FP_NAN Macro, C Language FP_NORMAL Macro, C Language FP_SUBNORMAL Macro, C Language FP_ZERO Macro, C Language fpclassify Function, C Language isfinite Function, C Language isinf Function, C Language isnan Function, C Language isnormal Function, C Language signbit Function, C Language isgreater Function, C Language isgreaterequal Function, C Language isless Function, C Language islessequal Function, C Language islessgreater Function, C Language isunordered Function, C Language sin Function, C Language cos Function, C Language tan Function, C Language asin Function, C Language acos Function, C Language atan Function, C Language atan2 Function, C Language sinh Function, C Language cosh Function, C Language tanh Function, C Language asinh Function, C Language acosh Function, C Language atanh Function, C Language exp Function, C Language frexp Function, C Language ldexp Function, C Language log Function, C Language log10 Function, C Language log2 Function, C Language exp2 Function, C Language expm1 Function, C Language log1p Function, C Language sqrt Function, C Language cbrt Function, C Language hypot Function, C Language erf Function, C Language erfc Function, C Language tgamma Function, C Language lgamma Function, C Language ceil Function, C Language floor Function, C Language fmod Function, C Language remainder Function, C Language remquo Function, C Language fdim Function, C Language fmax Function, C Language fmin Function, C Language fma Function, C Language fabs Function, C Language trunc Function, C Language round Function, C Language lround Function, C Language llround Function, C Language nearbyint Function, C Language rint Function, C Language lrint Function, C Language llrint Function, C Language copysign Function, C Language nextafter Function, C Language nexttoward Function, C Language fenv_t Type, C Language fexcept_t Type, C Language feclearexcept Function, C Language feraiseexcept Function, C Language fesetexceptflag Function, C Language fegetexceptflag Function, C Language fetestexcept Function, C Language fegetround Function, C Language fesetround Function, C Language fegetenv Function, C Language fesetenv Function, C Language feupdateenv Function, C Language FENV_ACCESS Macro, C Language ATOMIC_BOOL_LOCK_FREE Macro, C Language ATOMIC_CHAR_LOCK_FREE Macro, C Language ATOMIC_WCHAR_T_LOCK_FREE Macro, C Language ATOMIC_SHORT_LOCK_FREE Macro, C Language ATOMIC_INT_LOCK_FREE Macro, C Language ATOMIC_LONG_LOCK_FREE Macro, C Language ATOMIC_LLONG_LOCK_FREE Macro, C Language ATOMIC_POINTER_LOCK_FREE Macro, C Language atomic_is_lock_free Function, C Language atomic_store Function, C Language atomic_load Function, C Language atomic_exchange Function, C Language atomic_compare_exchange_strong Function, C Language atomic_compare_exchange_weak Function, C Language atomic_fetch_add Function, C Language atomic_fetch_sub Function, C Language atomic_fetch_or Function, C Language atomic_fetch_xor Function, C Language atomic_fetch_and Function, C Language atomic_thread_fence Function, C Language atomic_signal_fence Function, C Language alignas Specifier, C Language alignof Operator, C Language noreturn Function Specifier, C Language static_assert Macro, C Language Generic Selection, C Language _Generic Keyword, C Language _Atomic Keyword, C Language Complex Type, C Language Imaginary Type, C Language creal Function, C Language cimag Function, C Language cabs Function, C Language carg Function, C Language conj Function, C Language cproj Function, C Language cexp Function, C Language clog Function, C Language cpow Function, C Language csin Function, C Language ccos Function, C Language ctan Function, C Language casin Function, C Language cacos Function, C Language catan Function, C Language csinh Function, C Language ccosh Function, C Language ctanh Function, C Language casinh Function, C Language cacosh Function, C Language catanh Function, C Language cexpf Function, C Language clogf Function, C Language cpowf Function, C Language csinf Function, C Language ccosf Function, C Language ctanf Function, C Language casinf Function, C Language cacosf Function, C Language catanf Function, C Language cabsf Function, C Language cargf Function, C Language conjf Function, C Language cprojf Function, C Language csinhf Function, C Language ccoshf Function, C Language ctanhf Function, C Language casinhf Function, C Language cacoshf Function, C Language catanhf Function, C Language crealf Function, C Language cimagf Function, C Language creall Function, C Language cimagl Function, C Language fabsl Function, C Language sqrtl Function, C Language sinl Function, C Language cosl Function, C Language tanl Function, C Language asinl Function, C Language acosl Function, C Language atanl Function, C Language atan2l Function, C Language sinhl Function, C Language coshl Function, C Language tanhl Function, C Language acoshl Function, C Language atanhl Function, C Language expl Function, C Language frexpl Function, C Language ldexpl Function, C Language logl Function, C Language log10l Function, C Language log2l Function, C Language exp2l Function, C Language expm1l Function, C Language log1pl Function, C Language cbrtl Function, C Language hypotl Function, C Language erfl Function, C Language erfcl Function, C Language tgammal Function, C Language lgammal Function, C Language ceill Function, C Language floorl Function, C Language fmodl Function, C Language remainderl Function, C Language remquol Function, C Language fdiml Function, C Language fmaxl Function, C Language fminl Function, C Language fmal Function, C Language truncl Function, C Language roundl Function, C Language lroundl Function, C Language llroundl Function, C Language nearbyintl Function, C Language rintl Function, C Language lrintl Function, C Language llrintl Function, C Language copysignl Function, C Language nextafterl Function, C Language nexttowardl Function, C Language SIGINT Macro, C Language SIGTERM Macro, C Language SIGSEGV Macro, C Language SIGILL Macro, C Language SIGABRT Macro, C Language SIGFPE Macro, C Language int8_t Type, C Language int16_t Type, C Language int32_t Type, C Language int64_t Type, C Language uint8_t Type, C Language uint16_t Type, C Language uint32_t Type, C Language uint64_t Type, C Language uintptr_t Type, C Language intptr_t Type, C Language intmax_t Type, C Language uintmax_t Type, C Language int_least8_t Type, C Language int_least16_t Type, C Language int_least32_t Type, C Language int_least64_t Type, C Language uint_least8_t Type, C Language uint_least16_t Type, C Language uint_least32_t Type, C Language uint_least64_t Type, C Language int_fast8_t Type, C Language int_fast16_t Type, C Language int_fast32_t Type, C Language int_fast64_t Type, C Language uint_fast8_t Type, C Language uint_fast16_t Type, C Language uint_fast32_t Type, C Language uint_fast64_t Type, C Language INTMAX_MAX Macro, C Language INTMAX_MIN Macro, C Language UINTMAX_MAX Macro, C Language SIZE_MAX Macro, C Language PTRDIFF_MAX Macro, C Language PTRDIFF_MIN Macro, C Language WCHAR_MAX Macro, C Language WCHAR_MIN Macro, C Language WINT_MAX Macro, C Language WINT_MIN Macro, C Language MB_LEN_MAX Macro, C Language RSIZE_MAX Macro, C Language errno_t Type, C Language rsize_t Type, C Language K&R C, C Language ISO/IEC 9899 Standard, C Language Translation Phase 1, C Language Translation Phase 2, C Language Trigraph Replacement, C Language Universal Character Name Mapping, C Language Adjacent String Literal Concatenation, C Language Escape Sequence Processing, C Language Preprocessing Directives Execution, C Language Macro Replacement, C Language _Pragma Operator, ), #), C Language Conditional Inclusion, C Language __FILE__ Macro, C Language __LINE__ Macro, C Language __DATE__ Macro, C Language __TIME__ Macro, C Language __STDC__ Macro, C Language __STDC_VERSION__ Macro, C Language __STDC_HOSTED__ Macro, C Language __func__ Identifier, C Language Diagnostics, C Language Implementation Limits, C Language Implementation-defined Behavior, C Language Strict Aliasing Rule, C Language Type Qualifiers, C Language Conversion Rank, C Language Arithmetic Conversions, C Language Integer Promotions, C Language Usual Arithmetic Conversions, C Language Balancing Types, C Language Function Prototype, C Language Old-style Declaration, C Language Prototype Scope Variable, C Language Tentative Definition, C Language Linkage, C Language Internal Linkage, C Language External Linkage, C Language No Linkage, C Language Incomplete Type, C Language Complete Type, C Language Composite Type, C Language Decayed Type, C Language Adjusted Type, C Language Scalar Promotion, C Language POD Type (pre C11), C Language Object Representation, C Language Value Representation, C Language Effective Type, C Language Character Encoding, C Language Locale, C Language Localization Functions

C Language: C Fundamentals, C Inventor - C Language Designer: Dennis Ritchie in 1972; C Standards: ANSI X3J11 (ANSI C); ISO/IEC JTC 1 (Joint Technical Committee 1) / SC 22 (Subcommittee 22) / WG 14 (Working Group 14) (ISO C); C Keywords, C Pointers, C Data Structures - C Algorithms, C Syntax, C Memory Management, C Recursion, C on Android, C on Linux, C on macOS, C on Windows, C Installation, C Containerization, C Configuration, C Compiler, C IDEs (CLion), C Development Tools, C DevOps - C SRE, C Data Science - C DataOps, C Machine Learning, C Deep Learning, C Concurrency, C History, C Bibliography, Manning C Programming Series, C Glossary, C Topics, C Courses, C Standard Library, C Libraries, C Frameworks, C Research, C GitHub, Written in C, C Popularity, C Awesome List, C Versions. (navbar_c)

Memory management: Dynamic memory management, C language memory management, C dynamic memory allocation - C memory (malloc, realloc, calloc, C free, mimalloc), C Plus Plus memory | C++ memory (automatic storage duration, C Plus Plus auto | C++ auto, RAII), C Sharp memory | memory, Binary prefixes (kilo-mega-giga-tera-peta-exa-zetta-yotta), Manual memory management, Memory management (operating systems) (Linux memory - UNIX memory, Android memory, IBM mainframe memory, iOS memory, macOS memory, Windows memory), Memory: Memory address, Address space, Memory allocation - Memory allocator, Bash memory, Memory deallocation - Deallocation, Memory debugger (Memwatch, mtrace), Memory diffusion, Dynamic memory, Memory fence (Memory barrier), Memory fragmentation] - Fragmentation, Free list, Garbage collection - Garbage collector, Golang memory, Heap or Free store (Heap-based memory allocation), Stack (Call stack - Stack-based memory allocation - Stack (abstract data type) - LIFO (computing) - Stack frame - Stack unwinding), JVM memory (Java memory - Kotlin memory - Scala memory), Memory leak, Memory model, Memory paging, Out of memory, Page (computer memory), Pointers, C language pointers, Automatic pointer, Pointer swizzling, Memory pool, Memory protection, Physical memory, PowerShell memory, Python memory, RAM, Memory reference (Reference counting - Soft reference - Weak reference), Resource allocation (Resource Acquisition Is Initialization - RAII), Resource leak, Rust memory, Memory segmentation, Memory utilization, Shared memory, Static variable - Automatic variable, Virtual memory, Virtual address space. Category of Memory management. (navbar_memory_management. See also navbar_memory or navbar_data_storage)


Cloud Monk is Retired ( for now). Buddha with you. © 2025 and Beginningless Time - Present Moment - Three Times: The Buddhas or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


c_language_pointers.txt · Last modified: 2025/02/01 07:13 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki