The best quality editor you can fit a post, not using external libraries. Only include default headers/imports/libraries.
Programs will be judged by their array of features, stability of operation and memory use.
Name:
Anonymous2010-07-06 15:16
I'd like to state my entry, and motion that the deadline be the 100th relevant post.
You won't even allow a curses lib? That's bullshit. All contest limitations are arbitrary, but this one is going to make all entries suffer the fate of being worse than they could have been for having to reinvent the wheel for no good reason.
Plus, you didn't even set a deadline. You're bad at this.
To put the PC in ``raw'' mode, use ioctl with some magic numbers gleaned from msdos.c (Perl source file) and Ralf Brown's interrupt list (comes across the net every so often):
$old_ioctl = ioctl(STDIN,0,0); # Gets device info
$old_ioctl &= 0xff;
ioctl(STDIN,1,$old_ioctl | 32); # Writes it back, setting bit 5
int ret_val = ioctl (fd, DOS_SETDEVDATA, 0, dev_info);
ioctl(stdin,setDeviceInfo,
ioctl(0,1,);
redirect STDIN calls to record to file.
* Set stdin, stdout, and stderr to be the
* pseudo terminal.
dup2(i, 0);
dup2(i, 1);
dup2(i, 2);
*/
Name:
Anonymous2010-07-07 6:13
#include <iostream>
using namespace std;
int main(int argc, char[] argv) {
char* buf = new char[10000];
while ((2+2) == 4) {
char << cin;
cout >> '\n?';
}
}
>>32
Nonsensical complaint. Networking shouldn't be part of the standard library.
Im sorry to use imageboard speak but the level of idiocy in this statement is just overwhelmingHahahohwow.jpg.
GB2 1970s.
Not a library issue. Arguably not even a C issue, but a compiler and OS issue.
Library issue, the OS should only handle them not check programs activly at runtime for them, and the compiler cant even know should you make a routine which accesses memory dynamicly.
So yes it is deffinetly a library issue.
>>32 I'd love to hear you elaborate, but I have a feeling it's just going to be bullshit.
If the linker generates a warning if try to use puts that is real bullshit for me, why include a usefull function if it is "broken"?
everything could be fixed if you would just append a lenght integer upfront of arrays and functions to access them, but no people use C++ instead because its handling is less shitty and nobody likes segfaults.
Name:
Anonymous2010-07-07 8:13
If standard libs means "only functions present in libc":
#include <stdio.h>
#include <stdlib.h>
FILE *file;
char letter;
int main (int argc, char **argv)
{
if (argc < 2)
{
fprintf (stderr, "D'oh! you didn't specify a file.\nUsage:%s <filename>", argv[0]);
exit (1);
}
fopen (file, argv[1], "w");
if (!file) {
fprintf (stderr, "Could not open file %s\n");
exit (1);
}
while (!feof(char = getchar()))
{
fprintf (file, "%c", letter);
}
return 0;
}
Or, the best editor for *n?x hackers:
/* cc besteditorever.c -obesteditorever */
#include <stdlib.h>
char *editor
int main (int argc, char *argv)
{
editor = getenv ("EDITOR");
return (system (editor));
}