What do you want to save?
Add Code snippet
New code examples in category C
-
Awgiedawgie 2022-05-13 22:22:04
how to find length of string in c
#include <stdio.h> #include <string.h> int main() { char a[20]="Program"; char b[20]={'P','r','o','g','r','a','m','\0'}; // using the %zu format specifier to print size_t printf("Length of string a = %zu \n"... Add solution -
Awgiedawgie 2022-05-13 20:50:32
sdl texture error out of memory
void DrawTexture(SDL_Renderer *render, const char *path, Point pos, Size size) { SDL_Surface *image = SDL_LoadBMP(path); SDL_Texture *texture; SDL_Rect rect = {pos.x, pos.y, size.w, size.h}; if (!image) { printf("\n[ERROR... Add solution -
Awgiedawgie 2022-05-13 20:05:36
how to remove a node from a linked list in c
typedef struct node{ int value; //this is the value the node stores struct node *next; //this is the node the current node points to. this is how the nodes link }node; node *rmvNode(node *head, int index){ node *tmp = head; node *rmv; ... Add solution -
Awgiedawgie 2022-05-13 19:20:41
simple example of pointers
#include <stdio.h> #include <stdlib.h> int main() { int *nums; int x; // Allocate storage for 3 integers nums = (int *)malloc( sizeof(int) * 3 ); if( nums==NULL ) { fprintf(stderr,"Memory allocation error\n"... Add solution -
IllusiveBrian 2022-05-13 17:16:01
printf c float
printf("%0k.yf" float_variable_name) Here k is the total number of characters you want to get printed. k = x + 1 + y (+ 1 for the dot) and float_variable_name is the float variable that you want to get printed. Suppose you want to print x digi... Add solution -
Awgiedawgie 2022-05-13 17:10:17
recursion questions in c
#include <stdio.h> unsigned long long int factorial(unsigned int i) { if(i <= 1) { return 1; } return i * factorial(i - 1); } int main() { int i = 12; printf("Factorial of %d is %d\n", i, factorial(i)); retur... Add solution -
Awgiedawgie 2022-05-13 17:05:56
linguagem c imprimir ficheiro texto no ecra
#include <stdio.h> #include <stdlib.h> /* retorna 1 se 'c' é uma vogal, retorna 0 caso contrário */ int eh_vogal( char c ) { return ( c == 'a' || c == 'A' || c == 'e' || c == 'E' || ... Add solution
Best helpers
Ranking is empty