B
blackneos940
Guest
So here's the Code: :3
Can Mr. Penguin and Bethlehem guess it.....? That's right: It results in a Segmentation Fault....... :< I don't want the Gubmint exploiting that flaw..... How the fsck do I fix that.....? D: Yes, I had such strong Coffee that I grew Chest Hair on my Chest Hair....... :> Thanks for any help, you guys.......
Code:
#include <stdio.h>
int main(void)
{
printf ("Welcome to the Happy Shopper Program!\nType the items on your Shopping List, and then press Enter!\n");
char *items = "";
scanf ("%s", items);
FILE *ptr;
ptr = fopen("/home/adam/Documents/Shopping_Lists/Shopping_List.txt", "w");
fprintf (ptr, "%s", items);
fflush(ptr);
fclose(ptr);
return 0;
}
Can Mr. Penguin and Bethlehem guess it.....? That's right: It results in a Segmentation Fault....... :< I don't want the Gubmint exploiting that flaw..... How the fsck do I fix that.....? D: Yes, I had such strong Coffee that I grew Chest Hair on my Chest Hair....... :> Thanks for any help, you guys.......
