C++

Anything and Everything about Uplink

Moderators: jelco, bert_the_turtle, Chris, Icepick, Rkiver

Hama
level0
Posts: 4
Joined: Wed Nov 06, 2002 5:11 am

Postby Hama » Fri Nov 15, 2002 7:14 pm

Ok, I know this has probably been asked before and I know that this isint exactly Uplink related BUT you could program a virus with C++ and viruses are in Uplink so thats my excuse and I'm sticking with it.  Anyway, what I wanted to know was:
1. Is C++ just mean the newer version (like HTML 3, HTML 4) or do I have to learn C+ THEN C++?
(I know its a newb question but please bear with me)
How many boards could the mongols hoard if the mongol hordes got bored?
ToRmEnToR
level5
level5
Posts: 2420
Joined: Sun Jul 14, 2002 5:48 pm
Location: Israel
Contact:

Postby ToRmEnToR » Fri Nov 15, 2002 8:07 pm

Quote: from Hama on 6:14 pm on Nov. 15, 2002[br]
(I know its a newb question but please bear with me)


well, you are a n00b all the way, so let me educate you:

first of all, C comes before C++ , there is no C+... and yes, you should learn C before C++ tho you dont have to....

and viruses are created mostly in assembly, and not C++...
meow
Hama
level0
Posts: 4
Joined: Wed Nov 06, 2002 5:11 am

Postby Hama » Fri Nov 15, 2002 8:11 pm

lol, forgive my n00bness! thx though
How many boards could the mongols hoard if the mongol hordes got bored?
Hama
level0
Posts: 4
Joined: Wed Nov 06, 2002 5:11 am

Postby Hama » Fri Nov 15, 2002 8:14 pm

Explain Assembly
(yes, I know I am a newb to the extreme)
How many boards could the mongols hoard if the mongol hordes got bored?
lattera
level4
level4
Posts: 722
Joined: Mon Jun 24, 2002 2:25 am

Postby lattera » Fri Nov 15, 2002 8:18 pm

Quote: from Hama on 11:14 am on Nov. 15, 2002[br]Explain Assembly
(yes, I know I am a newb to the extreme)


ASM (Assembly) is what Microsoft coders can't do... ;)

You can code viruses in C++. Although, you'd pretty much have to use the inline ASM instructions. (so, basically you'd need to do it in ASM).

C is what C++ is created from. I much prefer C, but most prefer C++. (I guess I'm strange like that). If you need help, just msg me.
Chad Mulligan
level2
level2
Posts: 127
Joined: Sat Jan 05, 2002 4:56 am
Location: Mountain View, CA

Postby Chad Mulligan » Fri Nov 15, 2002 8:49 pm

C:  (canonical reference: "The C Programming Language"
   by Kernighan and Ritchie).
   It is quite possibly the most-used programming language in the world.
   It's a high-level extremely general-purpose imperative programming language that evolved along the same philosophy as ALGOL and FORTRAN:  programs read as step-by-step instructions, essentially.  The C standard, compared to Java, does not have that many "built-ins" like HTML or multimedia, so those are provided by third parties.  It can be extremely efficient in terms of computational cost (pointers help a LOT with this; of course, you have to be careful to do your own garbage collection).
 It has minimal support for the object-oriented paradigm; one could try, using structures and function pointers, but you get exactly squat help with abstraction or class hiearchies.
 C programs can be very platform-dependent if coded by people who either don't realize this or don't care.  This most shows when being lazy (e.g. not initializing variables or the contents of malloc'd arrays) or when doing cross-platform communications (e.g. forgetting about endianness issues when sending data over network or via transferring data files) or making assumptions about the sizes of types (e.g. pretending that (sizeof(int)==32), which isn't necessarily the case).


C++:  see additional stuff by Bjarne Stroustrop (sp?).  /Most/ C code is valid C++, but it's not quite a superset because of a new comment operator and new keywords which could cause problems if identifiers were named thusly.  It adds a number of features, such as
 - templates
 - classes, incl. hierarchy and abstraction
 - overloading, incl. of operators
 - a standard template library and, all-round, more built-ins(*)

(*) As far as I know, there are exactly zero compilers that fully comply with existing C++ standards incl. supporting every little feature.

It also introduces some issues regarding the mixing of compilers, c/o name mangling (summary:  do not use different compilers to compile different parts of a program).


'Assembly' is a generic term.  If you ever see a bozo who lists just plain 'assembly' on his resume, without specifying platform, he probably shouldn't be hired.  Background:

Machines store instructions as bit sequences of a given length.  In the IA32 architecture, instructions and their parameters must fit within 32 bits.  People, however, do not manipulate 32-bit binary strings very well, so they prefer to define a set of human-readable opcodes e.g. MOV (move), JNZ (jump if not zero), et al.  These instructions are completely architecture-dependent and should be avoided if you are even thinking that the program might be useful on another platform.  Writing in assembly code for a given platform (instructions = opcode + parameters, not bit strings or C e.g.) /may/ result in space-efficient, faster code (but it may be simpler to let a compiler optimize your high-level language), but it /will/ result in platform-dependent, nigh-undebuggable code.
"I tell you three times..."
sir hackalot
level3
level3
Posts: 451
Joined: Thu Apr 25, 2002 7:05 pm
Contact:

Postby sir hackalot » Fri Nov 15, 2002 8:49 pm

yes, C is a lot better than C++, i think easier to learn form the n00bs point of view, i think that if you learn C++ then you have got most of C covered. Also, you do not need to compile or C++ or C to create a virus, you cna create it other ways aswell, other programming languages, pascal, for instance is fun for making small programs.
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Fri Nov 15, 2002 9:22 pm

A major point of C++ (the ++ is the  increment operator in C, as in most languages, equivalent to C = C + 1) is that it is object oriented, much like Java and other new languages.  Many people actually suggest that you not learn C before C++ as you have to unlearn some of what you know, I however am not yet a huge fan of OOP and think C is a nice place to start programming.  As Chad Mulligan said Assembly is a low level language, though there is high level assembly, ie assembly in its most pure form has a one to one correspondence to machine (binary) language.  Basically every processor has a build in instruction set, i.e. add, move, etc., these are represented by binary codes on a computer, but that is rather hard to read and write, so assembly lables each binary code with a more readable representations, i.e. mov (move), add, etc.  Languages like C and C++ are high level languages meaning commands represent multiple machine instructions, like loops, print statements, etc.. :)
ReflectingGod
level5
level5
Posts: 2725
Joined: Sun Mar 17, 2002 4:40 pm
Location: W. Australia

Postby ReflectingGod » Fri Nov 15, 2002 9:51 pm

I skipped C and went straight to C++. I wouldn't want to get into ASM though... I did some machine code in electronics at college recently and I HATE it. Give me higher level languages any day...
ME!

Procrastination - Hard work often pays of after time, but laziness always pays off now!

**Bibo ergo sum!**
Hama
level0
Posts: 4
Joined: Wed Nov 06, 2002 5:11 am

Postby Hama » Sat Nov 16, 2002 1:01 am

Thanks everyone!
How many boards could the mongols hoard if the mongol hordes got bored?
User avatar
LLamaBoy
level5
level5
Posts: 1627
Joined: Sun Aug 18, 2002 12:18 pm
Location: Nicosia, Cyprus
Contact:

Postby LLamaBoy » Sat Nov 16, 2002 4:08 pm

Java is bettah than C++, I'm learning it at college now :biggrin:
It actually came from C++ but it's taken out all the crap difficult things like pointers (Boy, did I hate them... )

Anyway, it's very cool and I'm teaching myself to make games in it now! Watch out for Uplink: The applet!
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Sat Nov 16, 2002 6:18 pm

I just find Java too limiting.  After programming for a while in Perl and C/C++ you get use to doing whatever you want fairly easily.  In Java I just feel too constrained.  Some of Java also is just far too complicated to do simple stuff, get input from console, print to console (not complicated but System.out.print get annoying after a while).  Java is also quite a bit slower than C\C++ which makes it far less ideal for gaming.  :)
slyph
level1
level1
Posts: 72
Joined: Sat May 25, 2002 1:47 am
Contact:

Postby slyph » Sun Nov 17, 2002 2:02 pm

Anyone ever tried C-- ? It's (obviously) a derivative of C that is almost entirely assembler-based. It's an excellent mix of the two, and great for virus writing. For example you can switch to inline assembler code much easier, and switch right back into C statements. In response to the comment that viruses are written in ASM, I would say that viruses _were_ written in ASM. Although the infector component of any virus must be written in ASM, look at the most successful recent virii. Code Red/Nimda/Melissa/ILoveYou: two are written in VB (yecchhh) and two in C++. The Morris Worm was written in C  and bash script. Unfortunately, assembler is only good these days for the resident part of the virus which remains on the target computer and spreads through the exe files, much like a virus of old. Modern propagators have to be written in a higher level language, because I dont know *anyone* who can write netcode in ASM with the same flexibility as C. And in response to LLama Boy saying Java is better than C - it's likely that you're learning Java in college to teach you Object-Oriented Programming principles before you start learning C++. That's how it works at my university, you learn Haskell and Java in your first year, before moving on to the heavies like C and ASM. Java is better than C at ONE thing - deployability. One Java program can be deployed on almost any architecture, whereas C requires considerable porting over.

~Sigital
AnthonyS
level5
level5
Posts: 1943
Joined: Sat May 25, 2002 7:32 pm
Location: Southampton, UK
Contact:

Postby AnthonyS » Sun Nov 17, 2002 8:03 pm

VB is just too SLOW! The code is long and pointless, where as ASM code is extremel efficant.
Sonnybobiche
level3
level3
Posts: 432
Joined: Mon Dec 24, 2001 1:12 pm
Contact:

Postby Sonnybobiche » Mon Nov 18, 2002 4:46 am

You're trying to say that VB code is longer than assembly?
Listen, bub... if that was your point, you're a moron.
I bet you think Brainf*ck is very "efficant" too.

In any case...
I can't figure out how to get these if statements to work in C++. The code compiles, but does the same thing no matter what i input. The damned thing always thinks the shape is a circle!
cout << "c++ IF statements are crap" << endl;
If at first you don't succeed, skydiving is not for you...

Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 5 guests