G

@genie

24.03.09. basic type conversion(int ⇔ char)

C
2 years ago
#include <unistd.h> #include <stdio.h> int main() { //using printf char cbb = 'b'; printf("%c %d ", cbb, cbb); printf("\n");

24.03.09. printing ptrs

C
2 years ago
#include <stdio.h> int main() { //print adr of pt: printf("%p", (void*)p); int a = 1; int *ptr; ptr = &a; printf("a: %d, p: %p\n", a, (void*)ptr);

24.03.08 c++: iostream, cout

C++
2 years ago
#include <iostream> using namespace std; int main(int argc, char * argv[]) { int a = 10; cout<<a; cout << "Hello, World!" << endl; return 0; }

24.03.08 C00.06 ver1(2 ints, 2 strings)

C
2 years ago
#include <unistd.h> void ft_print_comb2(void) { int nb1; int nb2; char nb1_str[3]; char nb2_str[3]; nb1 = 0;

24.03.08 print 3-digits, each digit increasing, thus each digit not repeated(succeed)

C
2 years ago
#include <unistd.h> int main() { char a; char b; char c; a = '0'; while(a <= '9') {

24.03.08 print digits which are not repeated(succeed)

C
2 years ago
#include <unistd.h> void func(void) { int i, j, k; char digits[3]; i = 0; while (i < 10) {

24.03.08 print digits which are not repeated ver2(succeed)

C
2 years ago
#include <unistd.h> int main() { char digit[3]; digit[0] = '0'; while (digit[0] <= '9') { digit[1] = '0'; while (digit[1] <= '9') { digit[2] = '0';

24.03.08 print three-digits where no digit is repeated

C
2 years ago
#include <unistd.h> int main() { char digit[3]; digit[0] = '0'; digit[1] = '0'; digit[2] = '0'; while (digit[0] <= '9') { while (digit[1] <= '9') {

24.03.08. print digits

C
2 years ago
#include <unistd.h> int main() { char digit[3]; digit[0] = '0'; while(digit[0] <= '9'){ digit[1] = '0'; while(digit[1] <= '9'){ digit[2] = '0';

ps_ex00_04: aff_first_param

C
2 years ago
/* Assignment name : aff_first_param Expected files : aff_first_param.c Allowed functions: write -------------------------------------------------------------------------------- Write a program that takes strings as arguments, and displays its first argument followed by a \n. If the number of arguments is less than 1, the program displays \n.

ps_ex00_03: maff_alpha.c (finished)

C
2 years ago
/** Assignment name : maff_alpha Expected files : maff_alpha.c Allowed functions: write -------------------------------------------------------------------------------- Write a program that displays the alphabet, with even letters in uppercase, and odd letters in lowercase, followed by a newline. Example:

ps_ex01_02: ft_print_numbers (finished)

C
2 years ago
/* Assignment name : ft_print_numbers Expected files : ft_print_numbers.c Allowed functions: write -------------------------------------------------------------------------------- Write a function that displays all digits in ascending order. Your function must be declared as follows: void ft_print_numbers(void); */

ps_ex01_01: ft_countdown (finished)

C
2 years ago
/* Assignment name : ft_countdown Expected files : ft_countdown.c Allowed functions: write -------------------------------------------------------------------------------- Write a program that displays all digits in descending order, followed by a newline. Example:

ps_ex00_00: aff_a

C
2 years ago
/** Assignment name : aff_a Expected files : aff_a.c Allowed functions: write -------------------------------------------------------------------------------- Write a program that takes a string, and displays the first 'a' character it encounters in it, followed by a newline. If there are no 'a' characters in the string, the program just writes a newline. If the number of parameters is not 1, the program displays 'a' followed by a newline.

42_C04_ex02

C
2 years ago
/* Create a function that displays the number entered as a parameter. The function has to be able to display all possible values within an int type variable. Here’s how it should be prototyped : void ft_putnbr(int nb); */ #include <stdio.h>

42_C03_ex01

C
2 years ago
/* Create a function that displays a string of characters on the standard output. Here’s how it should be prototyped : void ft_putstr(char *str); */ #include <stdio.h> #include <unistd.h> void ft_putstr(char *str);

24.02.28. struct&pointer

C
2 years ago
/*** write a prog reading info and print them -use struct : item name, quantity, price, amount(price*quantity) -function: read item from user, use ptr as prmter -function: print items, use ptr as prmter -int main(): struct, ptr of struct, initialize both with NULL handle an error where mem alloc failed->terminate free ***/

24.02.28 ptr as a parameter to a struct

C
2 years ago
#include <stdio.h> #include <string.h> #include <stdbool.h> struct Fam { char me[20]; char mom[20]; char dad[20]; };

24.02.28. get info from user

C
2 years ago
#include <stdio.h> #include <string.h> #include <stdlib.h> // For malloc #define SLEN 20 struct User { char *id; int *age; };

24.02.28. struct→ptr, ptr as member of struct

C
2 years ago
#include <stdio.h> #include <string.h> struct User{ char id[10]; char name[20]; char email[30]; }; struct Data{ int *i1;