Quote (Ectasy @ Jan 11 2012 05:21am)
oh i see
i'm not too worried about picking up a new language for a job because it shouldnt be too hard to get.
only thing i'm worried about is what i will actually be asked to do with the language and not be too sure to do it
my computer science course was retardedly easy.. the midterm was literally like a payroll program, so i didn't really get a good bearing on programming from it
isn't struct essentially an abstract class? i dunno, i might be wrong since i only fiddled with c++ for an hour
no a struct doesn't need to be like a class at all. it CAN be since in c++ you can declare functions and member varialbes and all that shit within a struct. but it can also be something really simple like
struct bad_players_struct {
int WLR;
int KDR:
int numTimesLostToSmacktrickz;
} ectasy, garbo, dude150
then you basically have 3 members of the structure whose values you can edit just by doing something like
ectasy.WLR = 32;
ectasy.KDR = 0;
ectasy.numTimesLostToSmacktrickz = 4294967296 //maximum value for integer
its alot easier than making an entire new class then making 3 ojbects out of it then settings their instance variables. also whats really nice is you can cast structs to (void) type so you can pass them to functions really easy. like for example if you havea function which takes a void pointer (like most thread functions do), you can just do
thread_function( (void*) ectasy)
then you pass all this data to a thread in a nice "capsule" and no data corruption can occur and you can just get all the values and use inside thread operations
its really tough to explain this shit from a java perspective to be honest but they're useful, believe me