A

@Adarsh222

Difference between ++*p, *p++ and *++p

C
3 years ago
//https://www.geeksforgeeks.org/difference-between-p-p-and-p/ // PROGRAM 3 #include <stdio.h> int main(void) { int arr[] = {10, 20}; char a[]="hello"; int *p = arr; *++p;//*(++p)//so increments the next values

Precedence of postfix ++ and prefix ++ in

C
3 years ago
//https://www.geeksforgeeks.org/g-fact-59/ /* In C/C++, precedence of Prefix ++ (or Prefix –) has same priority than dereference (*) operator, and precedence of Postfix ++ (or Postfix –) is higher than both Prefix ++ and *. If p is a poin

Return

C
3 years ago
/*https://www.geeksforgeeks.org/return-statement-in-c-cpp-with-examples/ The return statement returns the flow of the execution to the function from where it is called. This statement does not mandatorily need any conditional statements

Return in switch

C
3 years ago
static uint32_t convertToMode(SECCRYPTOMGRCORE_OPERATION_MODE operationMode) { TEEC_OperationMode TEEC_Variable; switch (operationMode) { case SECCRYPTOMGRCORE_OPMODE_ENCRYPT: TEEC_Variable = TEEC_MODE_ENCRYPT;

How to avoid the structure padding

C
3 years ago
/* How to avoid the structure padding in C? The structural padding is an in-built process that is automatically done by the compiler. Sometimes it required to avoid the structure padding in C as it makes the size of the structure greater than the

Structure Padding

C
3 years ago
#include <stdio.h> struct aa{ char a,b; //int c;// see the difference in padding char d,e; //int c;// see the difference in padding }; int main(){

End a string forcefully

C
3 years ago
//https://www.includehelp.com/c/find-output-of-c-programs-2.aspx //https://www.includehelp.com/c/find-output-of-c-programs-3.aspx #include <stdio.h> #include <string.h> int main() { char str[20] = "ABCDEFGHIJK"; int s = strlen(str);

Structure vs Union

C
3 years ago
What is Structure? Structure is a user-defined data type in C programming language that combines logically related data items of different data types together. All the structure elements are stored at contiguous memory locations. Structure

struct imp basics

C
3 years ago
https://www.geeksforgeeks.org/structures-c/ Accessing Structure Members To access any member of a structure, we use the member access operator (.). The member access operator is coded as a period between the structure variable name and the structu

Array vs Linked list

C
3 years ago
https://www.geeksforgeeks.org/linked-list-vs-array/ Array: Arrays store elements in contiguous memory locations, resulting in easily calculable addresses for the elements stored and this allows faster access to an element at a specific index.

Array vs Malloc and array[] means imp

C
3 years ago
There are several different pieces at play here. The first is the difference between declaring an array as int array[n]; and int* array = malloc(n * sizeof(int)); In the first version, you are declaring an object with automatic storage duration.

Strings LL

C
3 years ago
#include <stdio.h> #include <string.h> #include <stdlib.h> struct Node{ char *data; struct Node *next; int a; };

concat integers

C
4 years ago
// C program to concatenate // two integers into one #include <stdio.h> #include <string.h> #include <stdlib.h> //imp // Function to concatenate // two integers into one int concat(int a, int b)

Binary Search Iteration Pgm

C
4 years ago
#include <stdio.h> int binarysearch(int a[],int x,int low,int high){ while(low<=high){ int mid=low+(high-low)/2; if(a[mid]==x){ printf("%d",mid); } if(a[mid]<x){

Binary search working

C
4 years ago
https://www.programiz.com/dsa/binary-search Binary Search Working Binary Search Algorithm can be implemented in two ways which are discussed below. Iterative Method Recursive Method The recursive method follows the divide and conquer appr

O notations MCQ

C
4 years ago
What is the time complexity of adding an item in front of a LinkedList? O(1) What is the time complexity of adding elements at the beginning of ArrayList? O(n) Indicate logarithm polynomial time complexity. O(n^const(const=2,3…) ) What i

Linear search vs Binary search

C
4 years ago
What is a linear search? A linear search is also known as a sequential search that simply scans each element at a time. Suppose we want to search an element in an array or list; we simply calculate its length and do not jump at any item. Comp

Linear Search

C
4 years ago
//Time complexity: O(N) //Auxiliary Space: O(1) #include <stdio.h> int search(int arr[],int sz,int src){ for(int i=0;i<sz;i++){ if(arr[i]==src){ printf("%d",i); } }

Enum with string

C
4 years ago
#include <stdio.h> #include <string.h> enum a{sun,mon,tue,wed}; int main(){ enum a d; char da[10]; scanf("%s",da);

Bubble sort

C
4 years ago
#include <stdio.h> int main() { int arr[5]; for(int i = 0; i < 5; i++) { if(scanf("%d", &arr[i]) != 1) { printf("Failed to get input.\n"); return 1; }