• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 4 pages
Exam (elaborations)

Altklausuren zu sysprak

Document preview thumbnail
Preview 1 out of 4 pages

4 Altklausuren von sysprak

Content preview

Gedächtnisprotokoll, die Reihenfolge der Aufgaben könnte anders gewesen sein. Bin mir auch nicht mehr
ganz sicher, welche der beiden Aufgaben (2,3) jetzt 2 Punkte gegeben hat.




Aufgabe 1, 2 Punkte: Schreibe einen Client (client.c), der Client soll eine Nachricht vom Server erhalten
(Server vorhanden und läuft) und diese Nachricht sofort wieder zurücksenden. Die Nachricht war „Hello
World!\0“. Man kann sich auf \0-Terminierung verlassen.
Tipp: manpage zu getaddrinfo(), enthält ein Beispiel


Aufgabe 2, 1 Punkt: Berechne die N-te Fibonacci Zahl. Alloziere dazu dynamisch ein Array und speichere
darin das Ergebnis. Gebe das Array bzw. das Ergebnis zurück. Die Funktion wurde 10-Mal aufgerufen (10te
Fibonacci Zahl).

Tipp 1: int array = malloc((n+1)*sizeof(int));

Tipp 2: array[0] = 0; array[1] = 1; for(int i = 2 ; i < N ; i++) array[i] = array[i-1] + array[i-2];


Aufgabe 3, 2 Punkte: Öffne eine Pipe und empfange einen String, sende diesen String zurück, jeder
Character soll großgeschrieben sein.

Tipp 1: manpage zu pipe() enthält ein Beispiel
Tipp 2: if (c < ascii_big_character_upper_limit && c > ascii_big_character_lower_limit) c -= 23;


Aufgabe 4, 1 Punkt: Führe die Funktion “abort()“ aus, wenn Signal N empfangen wird.

Tipp: signal(signum,sig_handler); und extra sig_handler() {abort();} schreiben, da MAKE/GCC sonst Fehler
produziert. Funktioniert aber auch ohne, also direkt mit signal(signum,abort);. Somit wäre die Aufgabe in
1 Zeile fertig.


Die Klausur hat insgesamt 6 Punkte, 2 Punkte reichen zum Bestehen. 3 Bonuspunkte möglich

Document information

Study
Uploaded on
February 11, 2025
Number of pages
4
Written in
2020/2021
Type
Exam (elaborations)
Contains
Only questions
$10.29

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
1
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions