Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2024/25/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Structs

(1) structs
#include <stdio.h>

typedef struct
{
    int x;
    int y;
} Point;

int main()
{
    Point a;
    a.x = 1;
    a.y = 2;

    Point c = {6, 5};

    printf("A(%d, %d)\n", a.x, a.y); // A(1, 2)

    printf("C(%d, %d)\n", c.x, c.y); // C(6, 5)

    return 0;
}
import std.stdio;

struct Point
{
    int x;
    int y;
}

void main()
{
    Point a;
    a.x = 1;
    a.y = 2;

    Point b = Point(3, 4);

    Point c = {6, 5}; // C-style

    writefln("A(%s, %s)", a.x, a.y); // A(1, 2)

    writefln("B(%s, %s)", b.x, b.y); // B(3, 4)

    writefln("C(%s, %s)", c.x, c.y); // C(6, 5)

    writeln(a); // Point(1, 2)
}
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2025 July 02, 12:11