Last active
July 14, 2017 18:41
-
-
Save ahmetilgin/c6f4b91234033a14c23cdb25fa287284 to your computer and use it in GitHub Desktop.
3 boyutlu Sınırsız Veri kapasitesi Vektör Struct kullanımı
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
using namespace std; | |
struct Noktalar | |
{ | |
double X; | |
double Y; | |
double Z; | |
}; | |
struct Sinif | |
{ | |
vector<Noktalar>Nokta; | |
void noktaEkle(double x, double y,double z){ | |
Noktalar Noktam; | |
Noktam.X = x; | |
Noktam.Y = y; | |
Noktam.Z = z; | |
Nokta.push_back(Noktam); | |
} | |
void noktaYazdir(){ | |
cout<<Nokta[0].X<<endl; | |
cout<<Nokta[0].Y<<endl; | |
cout<<Nokta[0].Z<<endl; | |
} | |
}; | |
int main(int argc, char const *argv[]) | |
{ | |
int sinifSayisi = 2; | |
struct Sinif Siniflar[sinifSayisi]; | |
Siniflar[0].noktaEkle(3,4,2); | |
Siniflar[0].noktaEkle(8,5,2); | |
Siniflar[0].noktaEkle(2,4,7); | |
ozel[0].noktaYazdir(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment