Tuesday, October 13, 2009

Here we go again

Well, I had a lovely long weekend where i literally ignored every school related thing, but anyways, I am completing my assignment until the big day tomorrow where we hand it in! :(.

int io_flag(..........)

int io_flag(const char *format, int row, int col, int* status, int radio);

io_flag() allows the user to make a single true/false selection. "status" points to the status of the selection, that can be zero or non-zero. If "status" is initially set to anything but zero, io_flag() corrects value to one. "format" holds the shape of the checkbox as io_displayflag() function.

io_flag() begins the selection by displaying the checkbox according to its “*status”. (Remember that the value of "*status" is corrected before the editing begins). Then the function waits for the user input.

  • If the user input is any of the printable keys (' ' <>
  • If the user input is SPACE:
    • If “radio” is true, then the *status is set to one, checkbox is displayed and function is terminated returning space.
    • If “radio” is false, then the value of *status is toggled between 0 and 1, the checkbox is displayed and function is exited returning space.
Sometimes i wish these things actually were in english not engrish cause these instructions are confusing, which makes the assignment harder.

So, i'm just going to jot down what I need to do here instead of using notepad.

  • If status is anything but 0, turns it into 1
  • format holds same shape of checkbox as io_displayflag
  • If the user input is any of the printable keys (' ' < key <= '~') excluding space, it should be ignored (no action taken).
  • If the user input is any of the function keys, the function is terminated returning the key.
Well, i guess i'll get on to it now.

Tuesday, September 22, 2009

Blogging?

Well i seriously lagged on this, but at least i'm doing it.

Well, apparently Fardad wants us to blog eh? Why? who knows but its worth marks! So, i have an awfully decision between ranting this whole blog thing or just go straight to what I've learned in Fardad's class, which is quite a lot of............ review!

Anywho, today, Fardad discussed about pointers! He showed us the deeper meaning of why pointers are being used and how efficient it is. I have several notes that i copied down of todays lesson and I guess i can summarize of what does what.

int pointer p; or char pointer c; // Variables pointer = *
p = &b;
p = Addressof b; p = 20
//^He mentioned in class that ampersand b means exactly the Addressof b.

/* b = 5000; */
wherePispointingto = 5000;
*p = 5000;

//^Also with asterisk p it just simply means where P is point to.

Always do int* p;
// ^I forgot why Fardad wanted us to do this, I guess it makes him feel big? haha I joke I joke.
// I assume ( ass-u-me ) that its because if you did add more pointers with in one data-type it
// will point itself to another pointer instead of individually having its own memory address? am //i on the right track? no?

a*b = multiplication
type* p; = pointer of this type

a**b; = a times, where b is pointing to

void* p; = checks unknown address value.

int a[10]={10,20,30,40,50,60,70,80,90,100}
print ("%d\n", *a);
Result = 10

a[3] = *(a+3) = means samething
arrays can be treated as pointer.


Well, thats all I have so, if you have any questions
Contact me @: oyoung4@learn.senecac.on.ca