init
This commit is contained in:
26
dnote-add.c
Normal file
26
dnote-add.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
int main()
|
||||
{
|
||||
char note[32];
|
||||
char cmd[42];
|
||||
char c;
|
||||
printf("a -add \n v -view\n");
|
||||
system("/bin/stty raw");//remove enter
|
||||
c = getc(stdin);
|
||||
system("/bin/stty cooked");
|
||||
if (c == 'a')
|
||||
{
|
||||
fgets(note,32,stdin);
|
||||
printf("you wrote: %s", note);
|
||||
snprintf(cmd,sizeof(cmd),"dnote add %s",note);
|
||||
}
|
||||
if (c == 'v')
|
||||
{
|
||||
snprintf(cmd,sizeof(cmd),"dnote view");
|
||||
}
|
||||
system(cmd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user