C Articles

Page 96 of 96

Difference between const char* p, char * const p, and const char * const p in C

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 13K+ Views

In C programming, *p represents the value stored at the address a pointer points to, and p represents the address itself. The const keyword can be applied to the char value, the pointer, or both. The thumb rule is to read declarations from right to left. The Three Declarations Declaration Read Right-to-Left Change Value (*p)? Change Pointer (p)? const char *p p is a pointer to a constant char No Yes char * const p p is a constant pointer to a char Yes No const char * const p ...

Read More

Difference between const int*, const int * const, and int const * in C

Mahesh Parahar
Mahesh Parahar
Updated on 14-Mar-2026 4K+ Views

In C programming, *p represents the value stored at the address a pointer points to, and p represents the address itself. The const keyword can be applied to either the pointer, the value it points to, or both, creating different levels of immutability. The thumb rule for reading these declarations is to read from right to left. The Three Declarations Declaration Read Right-to-Left Change Value (*p)? Change Pointer (p)? const int *p p is a pointer to a constant int No Yes int const *p p is a pointer to a ...

Read More

How to wrap python object in C/C++?

Gireesha Devara
Gireesha Devara
Updated on 12-Mar-2026 665 Views

To wrap existing C or C++ functionality in Python, there are number of options available, which are: Manual wrapping using PyMethodDef and Py_InitModule, SWIG, Pyrex, ctypes, SIP, Boost.Python, and pybind1. Using the SWIG Module Let’s take a C function and then tune it to python using SWIG. The SWIG stands for “Simple Wrapper Interface Generator”, and it is capable of wrapping C in a large variety of languages like python, PHP, TCL etc. Example Consider simple factorial function fact() in example.c file. /* File : example.c */ #include // calculate factorial int fact(int n) { ...

Read More
Showing 951–953 of 953 articles
« Prev 1 92 93 94 95 96 Next »
Advertisements