v_3c
main.cpp File Reference
#include <iostream>
#include <vector>
#include <cmath>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

vector< float > vec_init_1 (const int n)
 
void vec_init_2 (const int n, vector< float > &v)
 
void vec_init_3 (const int n, vector< float > &v)
 
void print_vek (const vector< float > &v)
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 73 of file main.cpp.

Here is the call graph for this function:

◆ print_vek()

void print_vek ( const vector< float > &  v)

Ausgabe eines Vektors mit cout

Parameters
[in]vVektor mt float- Elementen

Definition at line 62 of file main.cpp.

Here is the caller graph for this function:

◆ vec_init_1()

vector<float> vec_init_1 ( const int  n)

Speicherallokierung und Initialisierung eines C++-Vektors.

Parameters
[in]nAnzahl der Vektorelemente
Returns
initialisierter Vektor
Warning
Die Verwendung von at() ist sicher, aber verlangsamt den Code.

Definition at line 17 of file main.cpp.

Here is the caller graph for this function:

◆ vec_init_2()

void vec_init_2 ( const int  n,
vector< float > &  v 
)

Speicherallokierung und Initialisierung eines C++-Vektors.

Parameters
[in]nAnzahl der Vektorelemente
[out]vinitialisierter Vektor
Warning
Daten auf dem ubergebenen Vekor v gehen verloren.

Definition at line 33 of file main.cpp.

Here is the caller graph for this function:

◆ vec_init_3()

void vec_init_3 ( const int  n,
vector< float > &  v 
)

Speicherallokierung und Initialisierung eines C++-Vektors. Hier wird die Nutzung von push_back demonstriert, dies waere auch in Funktion vec_init_1 so moeglich.

Parameters
[in]nAnzahl der Vektorelemente
[out]vinitialisierter Vektor
Warning
Daten auf dem ubergebenen Vekor v gehen verloren.

Definition at line 50 of file main.cpp.

Here is the caller graph for this function: