diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C | |
| download | Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.gz Studium-33613a85afc4b1481367fbe92a17ee59c240250b.tar.bz2 | |
Diffstat (limited to 'Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C')
| -rw-r--r-- | Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C new file mode 100644 index 0000000..b0e5a36 --- /dev/null +++ b/Bachelor/Mikroprozessorsysteme2/ARM202U/EXAMPLES/OVERLAY/GETDATA.C @@ -0,0 +1,17 @@ +#include <stdio.h>
+
+int getData(char *buffer,int length)
+{
+ int charsIn;
+ int charRead;
+ charsIn=0;
+ for (charsIn=0;charsIn<length;) {
+ charRead=getchar();
+ if (charRead == EOF) break;
+ buffer[charsIn++]=charRead;
+ if (charRead == '\n' ) break;
+ }
+ for (;(charsIn%3)!=0; ) buffer[charsIn++]='\0';
+ return charsIn;
+}
+
|
