Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wektor_cpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
wektor_cpp
Commits
355a003b
Commit
355a003b
authored
Apr 28, 2026
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pierwsze operacje wektora - nagłówki
parent
89ec311c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
program.cpp
program.cpp
+11
-0
wektor.h
wektor.h
+18
-0
No files found.
program.cpp
View file @
355a003b
...
@@ -2,6 +2,17 @@
...
@@ -2,6 +2,17 @@
#include "wektor.h"
#include "wektor.h"
int
main
()
{
int
main
()
{
std
::
cout
<<
"Początek programu
\n
"
;
Wektor
w
;
w
.
push_back
(
10
);
w
.
push_back
(
11
);
w
.
push_back
(
12
);
std
::
cout
<<
"Element nr 0: "
<<
w
.
get
(
0
)
<<
'\n'
;
std
::
cout
<<
"Element nr 2: "
<<
w
.
get
(
2
)
<<
'\n'
;
w
.
set
(
2
,
222
);
std
::
cout
<<
"Element nr 2: "
<<
w
.
get
(
2
)
<<
'\n'
;
std
::
cout
<<
'\n'
;
std
::
cout
<<
"Koniec programu
\n
"
;
return
0
;
return
0
;
}
}
wektor.h
View file @
355a003b
...
@@ -3,5 +3,23 @@
...
@@ -3,5 +3,23 @@
#include <iostream>
#include <iostream>
/** Tablica zmiennej długości zawierająca wartości int. */
class
Wektor
{
public
:
Wektor
();
~
Wektor
();
/** Dodanie nowego elementu na końcu. */
void
push_back
(
int
e
);
/** Przypisanie nowej wartości na podanej pozycji. */
void
set
(
int
idx
,
int
e
);
/** Odczyt wartości spod podanej pozycji. */
int
get
(
int
idx
);
};
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment