GTAStunting

General => General Discussion => Computer Talk => Topic started by: DarkMatter on June 29, 2006, 11:36:14 PM

Title: First c++ program.
Post by: DarkMatter on June 29, 2006, 11:36:14 PM
Ok here it is, my first c++ program. It's extremely ghetoo (when you enter something other than intergers it will spaz). If someone here knows c++ please feel free to tell me how to improve apon this.  The source file is included in the zip.



Download the attachment :[attachmentid=2262]
Title: First c++ program.
Post by: yellow please on June 30, 2006, 02:31:35 AM
Im not downloading it , but is it source or compiled ? and whats it do
Title: First c++ program.
Post by: Jason on June 30, 2006, 04:12:29 AM
ive heard about C++, but im gonna stick with editing rather than creating thankyou
Title: First c++ program.
Post by: BlackPearl on June 30, 2006, 06:07:08 AM
Lol, downloaded it  pretty funny
Title: First c++ program.
Post by: Fugitive on June 30, 2006, 08:29:52 AM
I made somethig similar in Borland Pascal. Nice one.
Title: First c++ program.
Post by: DarkMatter on June 30, 2006, 08:17:10 PM
Yea. I made it work correctly today (realized the aligator mouth was pointing in the wrong direction )    >
Title: First c++ program.
Post by: marklund on July 02, 2006, 02:37:18 PM
http://homepages.shu.ac.uk/~sgreasle/seang...als/cpp/3/3.htm (http://homepages.shu.ac.uk/~sgreasle/seang/Tutorials/cpp/3/3.htm)

There's the tutorial you used.
Title: First c++ program.
Post by: DarkMatter on July 02, 2006, 02:39:05 PM
Lol yea you got it
Title: First c++ program.
Post by: Qouad on July 06, 2006, 05:18:33 PM
I don't know nothing about C++...but the program fucks up if you say you are X years old (X=what ever that is not a number)

Looks to me like you did nothing but changed the messages and ages needed, but I guess you've gotta start somwhere
Title: First c++ program.
Post by: DarkMatter on July 06, 2006, 11:30:45 PM
I did this tutorial step by step to understand some c++ commands and the syntax. I know it is basically copied but like i said. It's my first!

I am going to continue to learn c++ so expect some more programs from me.
Title: First c++ program.
Post by: Maxwell on July 12, 2006, 08:34:05 PM
LOL

type a letter in and see what it does

i made a prog like this with basic in the 5th grade
Title: First c++ program.
Post by: mikechml on July 13, 2006, 04:19:25 AM
Code: [Select]
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int iAge;
    char szInput[128];
    printf("Enter your age and press enter: ");
    gets(szInput);
    iAge = atoi(szInput);
    if (iAge < 13) {
        printf("You are a child because you are %d years old", iAge);
    }
    else if (iAge < 20) {
        printf("You are a teenager because you are %d years old", iAge);
    }
    else if (iAge < 66) {
        printf("You are an adult because you are %d years old", iAge);
    }
    else if (iAge < 136) {
        printf("You are an old fart because you are %d years old", iAge);
    }
    else {
        printf("Stop lying, idiot, you are not %d years old!", iAge);
    }
    return 0;
}

 
Title: First c++ program.
Post by: gunner on July 13, 2006, 01:43:01 PM
Quote from: mikechml
Code: [Select]
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
    int iAge;
    char szInput[128];
    printf("Enter your age and press enter: ");
    gets(szInput);
    iAge = atoi(szInput);
    if (iAge < 13) {
        printf("You are a child because you are %d years old", iAge);
    }
    else if (iAge < 20) {
        printf("You are a teenager because you are %d years old", iAge);
    }
    else if (iAge < 66) {
        printf("You are an adult because you are %d years old", iAge);
    }
    else if (iAge < 136) {
        printf("You are an old fart because you are %d years old", iAge);
    }
    else {
        printf("Stop lying, idiot, you are not %d years old!", iAge);
    }
    return 0;
}

Code: [Select]
//--------------------------------
//Converted to Visual basic 6
//By [NwP] Gunner
//Original code by mikechml
//--------------------------------

Private Sub Form_Load()


Dim age

if age =< "13" then
msgbox "You are a child because you are " & age & " years old."
elseif age =< "20" then
msgbox "You are a teenager because you are " & age & " years old."
elseif age =< "66" then
msgbox "You are an adult because you are " & age & " years old."
elseif age =< "136" then
msgbox "You are an old fart because you are " & age & " years old."
else
msgbox "Stop lying, idiot, you are not " & age & " years old!"
end if


End Sub

PS. dont ask me why i converted it ;|.
Title: First c++ program.
Post by: DarkMatter on July 13, 2006, 05:33:14 PM
Wow basic looks alot more basic compared to c++
Title: First c++ program.
Post by: Maxwell on July 13, 2006, 07:55:09 PM
gunners basic code is missing some stuff
Title: First c++ program.
Post by: gunner on July 14, 2006, 02:02:44 AM
yeah well, you'd have to add a textbox yourself in the designer mode
Title: First c++ program.
Post by: Mitopir on June 04, 2007, 07:36:22 AM
oh for crying out loud  this is the easiest kind of program u can even create...man..if u'd visit my sql..you would learn C++...real deal:D not some lame if else function thingys:D

i love c++
Title: First c++ program.
Post by: Vercitti Gang Boy on June 04, 2007, 10:14:21 AM
Nice bump
Title: First c++ program.
Post by: JL on June 04, 2007, 10:16:11 AM
Quote from: Vercitti Gang Boy
Nice bump

Nice useless comment.
Title: First c++ program.
Post by: Link on June 04, 2007, 01:11:09 PM
Quote from: darKy
Quote from: Vercitti Gang Boy
Nice bump

Nice useless comment.

Nice useless comment on his comment.


(this post wasn't useless because i needed to tell that his post was useless so he doesn't make useless post in some useless time again)
Title: First c++ program.
Post by: JL on June 04, 2007, 01:13:52 PM
lmao

b²t i would say...
Title: First c++ program.
Post by: VenomX on June 04, 2007, 01:39:41 PM
Links dead1!11
Title: First c++ program.
Post by: n0ah on June 05, 2007, 12:26:59 AM
Few years back i was crazy for C++, now I'm on break. Hmmn, maybe it's time to go back to it.
*installing C++*
Title: First c++ program.
Post by: Mitopir on June 06, 2007, 03:42:29 AM
im gonna write a C++ tutorial and post it here....i got notn else to do:D
SimplePortal 2.3.7 © 2008-2025, SimplePortal