Skip to content

Commit 63c03ec

Browse files
committed
new changes
1 parent 6a3c9bb commit 63c03ec

4 files changed

Lines changed: 113 additions & 1 deletion

File tree

.vscode/c_cpp_properties.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "windows-gcc-x64",
5+
"includePath": [
6+
"${workspaceFolder}/**"
7+
],
8+
"compilerPath": "C:/tdm64/bin/gcc.exe",
9+
"cStandard": "${default}",
10+
"cppStandard": "${default}",
11+
"intelliSenseMode": "windows-gcc-x64",
12+
"compilerArgs": [
13+
""
14+
]
15+
}
16+
],
17+
"version": 4
18+
}

.vscode/launch.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "C/C++ Runner: Debug Session",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"args": [],
9+
"stopAtEntry": false,
10+
"externalConsole": true,
11+
"cwd": "c:/Users/Desmon0x90/Desktop/dynamic-arrays",
12+
"program": "c:/Users/Desmon0x90/Desktop/dynamic-arrays/build/Debug/outDebug",
13+
"MIMode": "gdb",
14+
"miDebuggerPath": "gdb",
15+
"setupCommands": [
16+
{
17+
"description": "Enable pretty-printing for gdb",
18+
"text": "-enable-pretty-printing",
19+
"ignoreFailures": true
20+
}
21+
]
22+
}
23+
]
24+
}

.vscode/settings.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"C_Cpp_Runner.cCompilerPath": "gcc",
3+
"C_Cpp_Runner.cppCompilerPath": "g++",
4+
"C_Cpp_Runner.debuggerPath": "gdb",
5+
"C_Cpp_Runner.cStandard": "",
6+
"C_Cpp_Runner.cppStandard": "",
7+
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Auxiliary/Build/vcvarsall.bat",
8+
"C_Cpp_Runner.useMsvc": false,
9+
"C_Cpp_Runner.warnings": [
10+
"-Wall",
11+
"-Wextra",
12+
"-Wpedantic",
13+
"-Wshadow",
14+
"-Wformat=2",
15+
"-Wconversion",
16+
"-Wnull-dereference",
17+
"-Wsign-conversion"
18+
],
19+
"C_Cpp_Runner.enableWarnings": true,
20+
"C_Cpp_Runner.warningsAsError": false,
21+
"C_Cpp_Runner.compilerArgs": [],
22+
"C_Cpp_Runner.linkerArgs": [],
23+
"C_Cpp_Runner.includePaths": [],
24+
"C_Cpp_Runner.includeSearch": [
25+
"*",
26+
"**/*"
27+
],
28+
"C_Cpp_Runner.excludeSearch": [
29+
"**/build",
30+
"**/build/**",
31+
"**/.*",
32+
"**/.*/**",
33+
"**/.vscode",
34+
"**/.vscode/**"
35+
],
36+
"C_Cpp_Runner.useAddressSanitizer": false,
37+
"C_Cpp_Runner.showCompilationTime": false
38+
}

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
11
# dynamic-arrays
2-
arrays dinamicos, en definición, una implementación de vectores auto-redimensionables al estilo de lenguajes de alto nivel como C++. En este caso hemos hecho varias implementaciones de función C++ para controlar vectores pero en código C puro
2+
3+
----
4+
5+
Arrays dinamicos. En definición, una implementación de vectores auto-redimensionables al estilo de lenguajes de alto nivel como C++. En este caso hemos hecho varias implementaciones de función C++ para controlar vectores pero en código C puro.
6+
7+
Las funciones implementadas son las siguientes:
8+
9+
```C
10+
vector *new_vector(size_t size, size_t size_data);
11+
void print_vector_info(vector *my_vector);
12+
size_t vectores_sin_usar();
13+
size_t size(vector *my_vector);
14+
size_t max_size(vector *my_vector);
15+
void resize(vector *my_vector, size_t size);
16+
void free_vector(vector *my_vector);
17+
void *get_elment_v(vector *my_vector, size_t posicion);
18+
size_t vectores_reserbados();
19+
size_t vectores_ocupados();
20+
size_t get_size_position(vector *my_vector);
21+
size_t pop_back(vector *my_vector);
22+
size_t push_back(vector *my_vector, void *data);
23+
bool empty(vector *my_vector);
24+
void clear(vector *my_vector);
25+
```
26+
27+
Adicionalmente hay dos funciones que se ejecutan antes del `main` y al finalizar este. Su funcionalidad como constructores y destructores es liberar memoria reservada en el caso del destructor e inicializar y llevar un conteo de los vectores en el caso del constructor:
28+
```C
29+
void __attribute__((constructor)) __constructor_array_dinamic__();
30+
void __attribute__((destructor)) __destructor_array_dinamic__();
31+
```
32+
33+
34+
----

0 commit comments

Comments
 (0)