100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

Altklausuren zu sysprak

Rating
-
Sold
-
Pages
4
Grade
1
Uploaded on
11-02-2025
Written in
2020/2021

4 Altklausuren von sysprak

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Course

Document information

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

Subjects

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
$10.26
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
EasyTheOriginal

Get to know the seller

Seller avatar
EasyTheOriginal Ludwig-Maximilians-Universität München
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
10 months
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Frequently asked questions