// Here's a macro I use to define a type.
// You're welcome to use it, but I'll also show how the type is defined.
#define d_typedef_func_ty(return_z, name, ...) typedef return_z (*name)(__VA_ARGS__);
d_typedef_func_ty(int, int_2i_f, int, int); // creates a int(*)(int, int) function pointer
// which is equivelant to the following:
typedef int(*int_2i_f)(int, int);
//example that uses pointer as parameter
// function definition to swap the values.
void swap(int *x, int *y) {
int temp;
temp = *x; /* save the value at address x */
*x = *y; /* put y into x */
*y = temp; /* put x into y */
return;
}
Code Example |
---|
Cpp :: deletion in bst |
Cpp :: palindrome string |
Cpp :: C++ Area and Circumference of a Circle |
Cpp :: add for input output file in c/c++ |
Cpp :: loop in c++ |
Cpp :: constructor overloading in c++ |
Cpp :: std::string remove last |
Cpp :: aliasing c++ |
Cpp :: pointer to constant |
Cpp :: read from standard input cpp |
Cpp :: c++ short hand if else |
C :: auto click connect colab |
C :: C bitwise integer absolute value |
C :: c get time in milliseconds |
C :: c string is int |
C :: shuffle function in c |
C :: how to print hello world in c |
C :: lerp function c |
C :: Prime Number Check Program in C |
C :: best sites for loop practice c |
C :: A binary tree whose every node has either zero or two children is called |
C :: c how to check a palindrome string |
C :: c random array |
C :: uuidv4 javascript |
C :: c for loop |
C :: Convert mpg / mp4 to gif with ffmpeg |
C :: try and catch in rust |
C :: c functions example |
C :: latex remove page number from footer |
C :: binary search tree of strings in c |