Jump to content
xisto Community

HannahI

Members
  • Content Count

    351
  • Joined

  • Last visited

Everything posted by HannahI

  1. Okay, That is just freakishly large.
  2. Hi Guys,Yeah, Ubuntu setup is easy.I did it in about 2.5 minutes.
  3. I'm not sure what you mean, FirefoxRules.
  4. Here is the code.Start.c #include <string.h> #include <stdio.h> #include <stdlib.h> #include "start.h" #define TRUE 1 #define FALSE 0int login() { printf("Welcome to the Computer!\n"); printf("Type your username:\n"); printf("new-host-2:~ user$ "); char username[256]; scanf("%s", username); if(strcmp(username, "Hannah") != 0) { printf("\n Wrong! Type again:\n"); printf("new-host-2:~ user$ "); scanf("%s", username); if(strcmp(username, "Hannah") != 0) { printf("\n Hint: You; Type:\n"); printf("new-host-2:~ user$ "); scanf("%s", username); if(strcmp(username, "Hannah") != 0) { exit(0); } } } printf("\n Great! Password, Type ~ at the end:\n"); printf("new-host-2:~ user$ "); char password[256]; scanf("%s", password); if(strcmp(password, "password") != 0) { printf("Type Again:\n"); printf("new-host-2:~ user$ "); scanf("%s", password); if(strcmp(password, "password") != 0) { printf("Hint: Girl; Type:\n"); printf("new-host-2:~ user$ "); scanf("%s", password); if(strcmp(password, "password") != 0) { exit(0); } } } return 0; } char usernames[16][256]; char passwords[16][256];void setuser(char* username, char* password, int userID){ int x; int bFound = FALSE; if(userID>15) return; if(userID<0){ for(x=0;x<16;x++){ if(usernames[x]==0){ userID = x; bFound = TRUE; break; } } if(bFound == FALSE) { printf("Your account could not be created. Try again later."); return; } } strcpy(usernames[userID], username); strcpy(passwords[userID], password); } int loadUserDatabase() { FILE *fp; if(!(fp=fopen("users.dat","rb"))){ memset(usernames, 0, sizeof(usernames)); memset(passwords, 0, sizeof(passwords)); } else { fread( usernames, sizeof(usernames), 1, fp); fread( passwords, sizeof(passwords), 1, fp); } return 0; } int saveUserDatabase() { FILE* fp; if(!(fp=fopen("users.dat","wb"))){ fwrite(usernames, sizeof(usernames), 1, fp); fwrite(passwords, sizeof(passwords), 1, fp); } return 0; } Start.h int login();void setuser(char* username, char* password, int userID);int saveUserDatabase();int loadUserDatabase(); Main.c #include <stdio.h>#include <string.h>#include "start.h"void write() { for(;{ printf("Would you like to type; 4 lines only? Type Yes or No:\n"); char line1[256]; char line2[256]; char line3[256]; char line4[256]; char response[256]; printf("new-host-2:~ user$ "); scanf("%s", response); if(strcmp(response, "Yes") == 0) { scanf("%s", line1); printf("\n"); scanf("%s", line2); printf("\n"); scanf("%s", line3); printf("\n"); scanf("%s", line4); } else if(strcmp(response, "No") == 0) { break; } else { printf("-bash unknown command\n"); } } }void ask() { for(; { char response[256]; printf("Would you like to do any of the following\n"); printf("Writing, Logout\n "); printf("new-host-2:~ user$ "); scanf("%s",response); if(strcmp(response, "Writing") == 0) { write(); } else if(strcmp(response, "Logout") == 0) { break; } else { printf("-bash unkwown command\n"); } }}int main (int argc, const char * argv[]) { loadUserDatabase(); setuser("Derek", "Hannah", 1); login(); ask(); saveUserDatabase(); return 1;}
  5. Yeah, WHAT FILE IS IT IN?
  6. Hey, Guys.Moderators, If there is a better place for this, please move it! :DLet's begin.I made a project that ran on Unix. bUt that project was not any old project. It was special! It was special becuase it was Unix, except it was running on Unix. If you would like to take it for a test run your self, just leave me a comment to post it! Plus, it looks like Unix.Bye
  7. Not too special, I didn't get it.
  8. If you don't find it, it's probally not installed, but on your system.
  9. I'm trying ask what file it is defined in. E.G. #include <stdio.h>int main() {printf("Hello");}
  10. What file is the system command in?
  11. Sorry about the grammar. Also, what file is it in?
  12. What I'm tring to say is that, I want to make a flash on the screen in C; I know it would be possible directly in Unix by having a for loop that clears the screen the prints something.
  13. Yes, Yes, Yes and Yes.Now I'm actully learning something!
  14. I mean making a flash in C to work on Unix.
  15. Let's share UNIX commands. To start off, here are some. function - create a function - Syntax: function myfunction() { echo - print - syntax: echo hello -Hannah
  16. Hi Guys, I'm pretty sure that you all have a macintosh computer with Xcode tools installed on it, make sure it is a version that works on your pesonal system. If not please get it or leave this topic. If you are here, you should be able to do this. Directions: To start, open Finder. Then, open the developer folder. Open Examples from that folder. Then, open the TextEdit Folder Open textedit.xcodeproj Now Xcode should open.Once Xcode is open you'll be able to browse that source code of TextEdit. If you click Build and Go, TextEdit will open. -Hannah
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.