Vorbereitung auf Aufgabe 3

main
s.eser 2024-05-31 12:55:46 +02:00
parent 66d220ebc5
commit 88427ffa73
3 changed files with 28 additions and 6 deletions

19
.vscode/c_cpp_properties.json vendored 100644
View File

@ -0,0 +1,19 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [
"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-arm64"
}
],
"version": 4
}

Binary file not shown.

View File

@ -1,6 +1,4 @@
#include <iostream>
#include <string>
#include <fstream>
// Template für flexiblen Array Typ
template <typename T>
@ -38,7 +36,7 @@ public:
// Destruktor
~Container() {
// Speicherfreigabe von Array Inhalt
delete[] data;
// delete[] data;
}
// Überladung des [] Operators
@ -57,10 +55,10 @@ public:
}
};
int main() {
Container<char> readWavFile(){
// Erstellen der Klasseninstanz mit Konstruktor
Container<char> wavData(0);
// Pointer auf test.wav
FILE* input;
// Variable zum Abspeichern von Byte Größe der wav Datei
@ -90,7 +88,12 @@ int main() {
// Freigabe des FILE Pointer
fclose(input);
std::cout << "wavData: " << wavData.getArraySize() << std::endl;
return wavData;
};
int main() {
std::cout << "wavData: " << readWavFile().getArraySize() << std::endl;
return 0;
};