This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Numere complexe: | |
| parte reala | |
| parte imaginara | |
| z1 = a + bi | |
| z2 = c + di | |
| unhde i^1 = -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdlib.h> | |
| #include <string>//strcpy(sir1, sir2) | |
| char* str_cpy(const char* src ) { | |
| if(src == NULL) return NULL; | |
| size_t len = sizeof( src ) + 1; //\0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| int **mat; | |
| //mat = (int*)malloc(m * sizeof(int*)); | |
| //mat = [ptr1, ptr2, ptr3..] | |
| for(int i = 0; i < lines; ++i) { | |
| mat[i] = (int*)malloc(n * sizeof(int)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| functia malloc(n * sizeof(int)) dimensiunea total in bytes , nu initializeaza (continut medefinit) alocare simpla | |
| calloc(n, sizeof(int)) | |
| n = numarul de elemente, dimensiune per element , se initializeaza cu 0, cand ai nevoie de valori initiale cu 0 | |
| realloc(ptr, dimensiune_noua) , pointer existent, noua dimensiune total , | |
| pastreaza continutul vechi, restul este nedefinit, cand vrei sa redimensionezi un vector deja alocat. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| //#include <malloc.h> | |
| #include <stdlib.h>//malloc... | |
| #define MAX_NUME 30 | |
| #define NR_NOTE 3 | |
| typedef struct { | |
| char nume[ 30 ];// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| typedef struct { | |
| char denumire[20]; | |
| char unit_mas[10]; | |
| float cantitate; | |
| } Material; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <string.h> | |
| #define SIZE 100 | |
| typedef struct Student { | |
| char name[ 49 ];//0...49//ana ..asdasdasda sasdsasdkaskda;ksk asd;klasd;klask;lask;dask;d lasdkl;adks | |
| int varsta; | |
| float medie; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| 1 | |
| 2 | |
| 0 | |
| 0 | |
| 4 | |
| 5 | |
| vect[i] = {1,2,3,4,5,0,0}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void swap(int *a, int* b) { | |
| int temp = *a; | |
| *a = *b; | |
| *b = temp; | |
| } | |
| void swap2(void *a, void *b, int dim) { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #define MAX 20 //dimensiunea maxima a tabloului | |
| int main(int argc, char const *argv[]) | |
| { | |
| int a[ MAX ];//tabloul citit de la tastatura | |
| int n, i; |