Commit e25f7be1 authored by ta_wu's avatar ta_wu

Latex-Vorlage, kommentare zu Quellcode a1

parent 024017da
Dies ist das Git-Repository der Gruppe 08 für TeI2 der Universität
Bremen im Wintersemester 2016/2017
File added
File added
\catcode `"\active
This diff is collapsed.
File added
No preview for this file type
LINK.o = $(
CFLAGS=-Werror -Wall -Wextra -g -O2 #-pg
CXXFLAGS=-Werror -Wall -Wextra -g -O2 #-pg
.PHONY: all clean
all: $(PROGRAMS)
-$(RM) *~ *.o core $(PROGRAMS)
File added
#include <iostream>
#include <cerrno>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char **argv){
int fd_in, fd_out; // file destination input and output
char buf[1024]; // buffer for writing
ssize_t szr; // read. ssize_t for error handling (returns negative numbers)
bool ok = true; // validity boolean
if (argc != 3) { // too few or too many arguments. Must be mycp 2 3
std::cerr << "Usage: " << argv[0] << " source destination" << std::endl;
return -1;
from man open
RDONLY Open the file for reading only.
if ((fd_in = open(argv[1],O_RDONLY)) == -1){ // if origin is read-only
return -1;
from man open
WRONLY Open the file for writing only.
CREAT Create the file if it does not already exist (without
this flag it is an error for the file not to exist).
TRUNC If the file exists it is truncated to zero length.
Name open - Open a file-based or command pipeline channel
This command opens a file, serial port, or command pipeline and returns
a channel identifier that may be used in future invocations of commands
like read, puts, and close. If the first character of fileName is not
| then the command opens a file: fileName gives the name of the file to
open, and it must conform to the conventions described in the filename
manual entry.
from GNU C Library - Permission Bits
S_IRUSR Read permission bit for the owner of the file. Often 0400.
S_IWUSR Write permission bit for the owner of the file. Usually 0200.
if ((fd_out = open(argv[2],O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR)) == -1){
return -1;
while (ok && ((szr = read(fd_in, buf, sizeof(buf))) > 0)) { // file valid and not empty
ssize_t szw = 0; // file to write
while (szw < szr) {
if ((szw = write(fd_out, buf, szr)) < 0) { // if write size is negative
ok = false;
} else {
szr -= szw;
return 0;
File added
% line41 rbp * rax = 0xfffffffdf48 * 0xfffffffdf58 = 0xF.FFFFFFBEA×10^21
% Nr, Abgabedatum, Gruppenleiter, Gruppenname, Name1...Name4
\Abgabeblatt{6}{12.12.2016}{Arian Mehrfard}{E08}%
{Sina Ganbar-Haidary}{Collins Audrey Souop Tagne}%
{Alexander Link}{Tammo Wübbena}%
\section*{Aufgabe 1}
\section*{Aufgabe 2}
\section*{Aufgabe 3}
\ProvidesClass{ti2}[2009/10/27 Ingo Sieverdingbeck]
% -----------------------------------------------------------------------
% Required packages
% -----------------------------------------------------------------------
% define page layout using typearea
% -----------------------------------------------------------------------
% define page style
% -----------------------------------------------------------------------
% Macro für das Abgabeblatt
% -----------------------------------------------------------------------
Technische Informatik 2\hspace{20ex} WS 2016/17\\ Tutor: {#3}\\ \hspace{70ex} \\
{\Huge\textsf{{#9} {#1}}} \hspace{10ex} \begin{tabular}{c|c|c|c|c|c}1&2&3&4&5&$\sum$\\\hline &&&&&\end{tabular}\\[1.5ex]
{\Large L\"osungsvorschlag} \\[1ex]
{\Large Abgabe: {#2}} \\[1ex]
\end{tabular} \\[2ex]
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment