What was your first C project? Please explain it well or even postit here (oh ya and don't tell me any of this "Hello World" stuff...I mean your first good project!
What was your first C project? Please explain it well or even postit here (oh ya and don't tell me any of this "Hello World" stuff...I mean your first good project!
my all too famous (among unix users)
encrypt
basic as hell but also USEFULL as hell!Code:/* * encrypt.c * encrypt: a program to encrypt a string using MD5 * compile: * gcc encrypt.c -o encrypt -lcrypt * execution: * encrypt [key] * Copyright (C) 2002 Lucas Campbell This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA License may be found at http://cyber.homeunix.net/linux/gpl.txt */ #include <stdio.h> int main(int argc, char* argv[]) { if(argv[1] != NULL) { printf("%s\n",argv[1]); printf("%s\n",crypt(argv[1],"$1$Lorraine")); } else { printf("Usage: encrypt [key]\n"); } return 0; }
Lorraine is the salt (name of girl I liked)
it may be changed to your liking, working on new one in which salts are random or inputted by user.
Currently finishing Steve project and NetSteve
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
ofcourse "hello world"
all great programmers start with "hello world"
so y not
well, i think he means something you can call your "own" and has a TRUE purpose to serve something or someone.
Asking the right question is sometimes more important than knowing the answer.
Please read the FAQ
C Reference Card (A MUST!)
Pointers and Memory
The Essentials
CString lib
A combination of lots of different things. I have a stand alone hard drive with lots of emulation related things on it and 3 C programs written by me. One being Install. It uses a self-tinkered CopyFile function to do the file transfering. Then Remove.exe which simply removes everything copied by Install.exe. Finally Menu.exe which is a selection menu for all emulators not offering a GUI ( on a major scale ). This stand-alone hard drive can be hooked into any PC in which after doing so you run Install.exe. Install copies everything to the C: drive in a rightfully titled folder emulation. It copies with neat directory structure and sets up Menu.exe for use and notifies the user of Remove.exe.
One thing sets it all up ready to go. The directory structure and associated files are also arranged so new emulators, and roms may be added into the setup very easily.
It's sort of a "modular" storage device. It's most definately a WIP.
The world is waiting. I must leave you now.
Ummm...isnt the crypt function available from the cmdline on most nixes?basic as hell but also USEFULL as hell!
my first finished real code project was a fight with a goblin... started before i knew how to use functions or anything about a few weeks into progamming, i eventually completed it with the use of one function and things i learned as i went along, the code is a mess and i'd be embarassed to post it.
ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.
...now ain't THAT the God's honest truth!! I still get a kick reading my old code. My first real attempt at a program was one that allowed the user to choose an element and let the program find the most probable atomical matches. It was cool to type in: "Oxygen" and see that old black box spit out: "Found O-H-H" (water!). I was so proud of myself!
... the code is a mess and i'd be embarassed to post it.
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }