Vorbereitung auf Aufgabe 3
parent
66d220ebc5
commit
88427ffa73
|
@ -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
|
||||
}
|
BIN
Aufgabe1_2
BIN
Aufgabe1_2
Binary file not shown.
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue