What you hate about UNSW (2 Viewers)

Omie Jay

gone
Joined
Nov 8, 2006
Messages
6,673
Location
in my own pants
Gender
Female
HSC
2007
i got decent coverage of wifi in ASB when i used to hang there with friends..

mabe my laptop is just awesome, mabe its a certain room..
 

darkwolfzx

Active Member
Joined
Oct 25, 2006
Messages
1,296
Gender
Undisclosed
HSC
N/A


lol FAIL.

ASB lifts cant tell what level it is in.
rofl

you should try the lift in the east wing of the red centre. The displays flicker and crackle like some scene out of The Ring
 

Omie Jay

gone
Joined
Nov 8, 2006
Messages
6,673
Location
in my own pants
Gender
Female
HSC
2007
@ Muimo: u doing comp1911? i got the course textbook from last year (PROGRAMMING PROBLEM SOLVING & ABSTRACTION WITH C, alistair moffat), rrp is like 65 i think, i sell to u for $30?
 

Muimo

New Member
Joined
Jul 17, 2008
Messages
18
Gender
Male
HSC
2007
@ Muimo: u doing comp1911? i got the course textbook from last year (PROGRAMMING PROBLEM SOLVING & ABSTRACTION WITH C, alistair moffat), rrp is like 65 i think, i sell to u for $30?
nah I'm doing a Computational Physics subject where we program in "c"
 

Muimo

New Member
Joined
Jul 17, 2008
Messages
18
Gender
Male
HSC
2007
Code:
#include <stdio.h>

int main(int argc, char *argv[]) {
  printf("Hai fag\n");
  return 0;
}


how do i create functions ?

(obviously the main() is a function) but how do i make a function lets say making a function that squares a number.

how would i make that function and secondly how would i refer to it in my main program ?
 
Last edited:

xprshn

bum...
Joined
Sep 2, 2004
Messages
88
Location
the west !
Gender
Male
HSC
N/A
how do i create functions ?

(obviously the main() is a function) but how do i make a function lets say making a function that squares a number.

how would i make that function and secondly how would i refer to it in my main program ?

#include <stdio.h>

void doYourMum(){

printf("I want to do your mum\n");

}

int main(int argc, char *argv[]) {

doYourMum();
return 0;
}
 

Dumsum

has a large Member;
Joined
Aug 16, 2004
Messages
1,552
Location
Maroubra South
Gender
Male
HSC
2005
#include <stdio.h>

void doYourMum(){

printf("I want to do your mum\n");

}

int main(int argc, char *argv[]) {

doYourMum();
return 0;
}
Or if you want to pass arguments...

Code:
#include <stdio.h>

void doYourMum(int x){
   
  printf("I want to do your mum %d times\n",x);
      
}

int main(int argc, char *argv[]) {

  doYourMum(8);
  return 0;
}
 

darkwolfzx

Active Member
Joined
Oct 25, 2006
Messages
1,296
Gender
Undisclosed
HSC
N/A
or the other way round, with function prototypes, a for loop and a constant...

Code:
#include <stdio.h>

#define MAGIC_NUMBER 9001

void fun(int x);

int main (int argc, char* argv[]) {
   printf("OVER NINE THOUSAND!!!\n");
   fun(MAGIC_NUMBER);
   return 0;
}

void fun (int x) {
   for (int i = 0; i <= x; i++) {
      printf("over 9000 ");
   }
}
Actually this is a better version

Code:
#include <stdio.h>

int main (int argc, char* argv[]) {
   int i = 0;
   while (i < 1) {
      printf("penus");
   }
   return 0;
}
 

Muimo

New Member
Joined
Jul 17, 2008
Messages
18
Gender
Male
HSC
2007
Hey guys you know how in VBA you can press a button and it goes through your program step by step ?

Can you do that in "C ? "
 

darkwolfzx

Active Member
Joined
Oct 25, 2006
Messages
1,296
Gender
Undisclosed
HSC
N/A
old farts used to use a debugger called ddd which is command line only. type ddd (executable name) and play around. read the man page for more info. you might prefer to use a graphical interface instead, so use gdb.
 

Omium

Knuckles
Joined
Feb 7, 2008
Messages
1,738
Location
Physics
Gender
Male
HSC
2007
I am a very patient person.

There is this stereotypical jewish guy who has been in the physics study room for the past few days.

His phone rings every 5-10 minutes, which he allows to ring for about 30 secs followed by a conversation in the room for another few minutes..

This process is repeated every 10 minutes or so.


Question1: What should i do ?

Question2: Do i seek the "advice" of the BoS anti-Israeli league?

;)
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Top