erasing every letter before my cursor
Name:
Anonymous
2008-09-14 16:52
sup /prog/
i'm reading a textfile (in C with getc()) an i want to erase all letter who are before my cursor, how can i do that?
Name:
Anonymous
2008-09-14 17:01
Use a real text editor, what the fuck.
Name:
Anonymous
2008-09-14 17:05
Name:
Anonymous
2008-09-14 17:13
C-space C-a C-w
Name:
Anonymous
2008-09-14 17:39
>>1
back to anonEmacs, please
Name:
Anonymous
2008-09-14 17:43
>>2
what? i'm doing it in C, once i've located a word, i want to erase (or remplace by "0") everything that are before the located word
Name:
Anonymous
2008-09-14 17:52
Use linked lists for O(1) erasing of letters.
Name:
Anonymous
2008-09-14 17:58
Name:
Anonymous
2008-09-14 18:07
>>7
He obviously needs a binary 2-3 AVL splay treap to get amortized O(α(n)) erasing.
Name:
Anonymous
2008-09-14 18:12
truncate(fileno(f), ftell(f));
Name:
Anonymous
2008-09-14 18:22
Name:
Anonymous
2008-09-15 12:25
>>10
well, it seems op understood that, but i dont, what is "f"? my filename?
and truncate(); doesn't seems to exist (google)
Name:
Anonymous
2008-09-15 12:36
>>12
Are you some kind of retard?
$ man ftell
FSEEK(3) FreeBSD Library Functions Manual FSEEK(3)
NAME
fgetpos, fseek, fseeko, fsetpos, ftell, ftello, rewind -- reposition a
stream
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <stdio.h>
int
fseek(FILE *stream, long offset, int whence);
long
ftell(FILE *stream);
...
$ man truncate
TRUNCATE(2) FreeBSD System Calls Manual TRUNCATE(2)
NAME
truncate, ftruncate -- truncate or extend a file to a specified length
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
int
truncate(const char *path, off_t length);
...
Maybe try installing an actual operating system?
Name:
Anonymous
2008-09-15 15:12
>>13
No, he's some kind of troll.
Name:
Anonymous
2008-09-16 12:30
Name:
Anonymous
2008-09-16 12:46
Name:
Anonymous
2010-11-15 16:14