A

@Adarsh222

basic

C
4 years ago
/*diff between define and typedef Difference between typedef and #define: ->>>A macro is a piece of code in a program that is replaced by the value of the macro. Macro is defined by #define directive. Whenever a macro name is encountered by the co

typedef enum

C
4 years ago
#include <stdio.h> #include <stdlib.h> #include <stdio.h> typedef enum { a1=49, a2 }name;

Types of pointers in c

C
4 years ago
Types of Pointers There are eight different types of pointers which are as follows − Null pointer Void pointer Wild pointer Dangling pointer

preprocessor and constant and Header

C
4 years ago
#define is is pre processor directive, no memory is allocated and it is not terminated with ";" const is allocated identifier size of memory in read only portion. Header file:- Header files help in reduction of repetitive code Correctly

*ptr[10] and (*ptr)[10] diff

C
4 years ago
#include <stdio.h> #if 0 int main(){ int (*ptr)[10]; int a[10]={99,1,2,3,4,5,6,7,8,9}; ptr=&a; printf("%d",(*ptr)[1]); } #endif

**p and *p[] diff

C
4 years ago
#include<stdio.h> void display(int n, char *str[]) { int i=0; while(i<n) printf("%s ",str[i++]); } int main() { display(1,"Hello"); return 0;

array and pointer diff

C
4 years ago
//#if 0 #include <stdio.h> int main() { const char *s = "geeksquizahhdcha"; printf("%lu", sizeof(s)); printf("\n%c", s[1]); return 0; }

harman basics

C
4 years ago
https://provenrun.com/services/security-engineering/ https://provenrun.com/products/provencore/

Time complexity

C
4 years ago
https://www.geeksforgeeks.org/understanding-time-complexity-simple-examples/#:~:text=So%2C%20the%20time%20complexity%20is,C The Time Complexity of an algorithm/code is not equal to the actual time required to execute a particular code, but the

Without semicolon print 1-10

C
4 years ago
#include <stdio.h> #define N 10 int main(int i) { while(i<=N && printf("%d",i) && i++){ } } always while ++ -- like puzzles the value will be treted from right to left

Pointer to constant

C
4 years ago
/* See following declarations to know the difference between constant pointer and a pointer to a constant. int * const ptr —> ptr is constant pointer. You can change the value at the location pointed by pointer p, but you can not change p to point

static

C
4 years ago
/* Static variables have a property of preserving their value even after they are out of their scope! Hence, static variables preserve their previous value in their previous scope and are not initialized again in the new scope. Following are so

Extern

C
4 years ago
#if 0 #include <stdio.h> extern int a; // int var; -> declaration and defination // extern int var; -> declaration /* Here, an integer type variable called var has bee

pointer to an array

C
4 years ago
#include<stdio.h> int main() { int arr[5] = { 1, 2, 3, 4, 5 }; int *ptr = arr; printf("%d\n", *ptr); printf("%p\n", ptr); return 0;

size of pointer

C
4 years ago
the size of a char pointer in a 32-bit processor is 4 bytes, while the size of a char pointer in a 64-bit processor is 8 bytes. 1) no matter char variable, int, float all size are same 0x0A etc. the size of the character pointer is 8 bytes. Note:

array basics

C
4 years ago
Pretty Simple program.. huh… Output will be 0. Now if you replace arr[0] with 0[arr], the output would be same. Because compiler converts the array operation in pointers before accessing the array elements. e.g. arr[0] would be *(arr + 0) and

Pointer to integer or char basics

C
4 years ago
#include <stdio.h> #if 0 int fun(int *p) { int n=10; int *q = &n; // char to pointer is different p = q; // pointer to pointer so the q value can be copied printf("%d",*p); // the pointer value cannot be passed to the main

exit(0)

C
4 years ago
#include <stdio.h> #include <stdlib.h> // Driver Code int main(void) { printf("START"); exit(1);//or exit(0) both are same // The program is terminated here

Static function

C
4 years ago
#include <stdio.h> /* In C, functions are global by default. The “static” keyword before a function name makes it static. For example, below function fun() is static. */ static int fun(void){ printf("I am a static function ");

Function basics

C
4 years ago
#include <stdio.h> int addNumbers(int a, int b); // function prototype /* The Function prototype serves the following purposes – 1) It tells the return type of the data that the function will return. 2) It tells the number of arguments