// esimene.cpp : Defines the entry point for the console application. #include "stdafx.h" #include "punkt.cpp" #include #include using namespace std; int main() { struct punkt p1; p1.x = 3; p1.y = 5; p1.kuva(); struct punkt p2 = p1; struct punkt *p3 = &p1; cout << p1.x << endl; p1.x = 4; cout << p2.x << endl; cout << p3->x << endl; string teade = "tere"; string *teade2 = &teade; string numbrid = "25"; // int m1[3]; int *m1 = (int *)malloc(3 * sizeof(int)); int *m2 = (int *)malloc(3 * sizeof(int)); int *m3 = &m2[1]; int *m4 = m2 + 1; //m1[3] = 12; m2[1] = 7; m2[2] = 9; cout << m1 << " " << m2 << endl; cout << m2[0] << endl; cout << m3[0] << endl; cout << m3[1] << endl; cout << *m4 << endl; cout << *(m4+1) << endl; cout << m1[0] << " " << m2[0] << endl; cout << teade << " " << teade.length() << endl; cout << *teade2 << " " << teade2->length() << " " << (*teade2).length() << endl; cout << teade[2] << " " << sizeof(int) << endl; cout << atoi(numbrid.c_str())*2 << endl; return 0; }