Thursday, January 28, 2010

week 3 challenge - bio_putint(int val)

My result as below, has been test.
void sep(int val)
{
    int i;
    if (val/10)
    {
        i = val % 10;
        sep(val/10);
    }
    else
        i = val % 10;
    _putch(i?i+48:48);
}
void bio_putint(int val)
{
    sep(val);
}

Wednesday, January 27, 2010

First IRC meeting

In our first IRC meeting, Fardad introduced some guidelines to us to get familiar with IRC environment and its culture. Through the meeting, we impressed the knowledge we learned from the classes. Meanwhile, we learnt lots new knowledge. There are two interested website as:
http://www.pastebin.ca is a website to copy the text and post it, then copy the url and pass the url share with your friend.
http://tinyurl.com is a website to help you make a long url short to tiny one. When you clicked the short one, it will redirect to the long one.

Starting from IRC is very good for us to get start to familiar with developing environments. For open source programming, by WIKI or IRC is very common for people communicating with their teammates.

But be honest, IRC meetings and chats are very slow. Especially when talking with an 8 people’s group, some people did not pay attention that will cause the meeting last much longer. And Fardad need to talk to all the groups that will take him longer time.
Is there better way to solve this problem?

Monday, January 25, 2010

The declaration and algorithm about Pointers

I.Declare a pointer

int* p;     p is an integer pointer variable
int* p[n];   p is a pointer array by the amount of n-pointer pointing to an integer elements
int* p();   p points to a function which return an integer pointer
int (*p)();   p is a function pointer, points to a function which return an integer value
int** p;    p is an pointer variable points to another pointer, this pointer point to an integer

II. Algorithm
(1)get address:

use "&" get the address of the variable

(2)get value:

use "*" get the target of the pointer

(3)assign operate:

·assign variable address to an pointer
int i;
int* p = &i;
·between the same type pointer variable assignment
int* p = &i;
int * q = p;
·address of the first element in the array assign to pointer
int a[3]={10,20,30};
int* p = a;
·assigned to the function entry address of a pointer variable
typedef int (*funcptr)();
funcptr p;
extern int foo();
p = &foo;

(4)Addition and Subtract

·array pointer
int a[5]={10,20,30,40,50};
int* p = a;
p+=3; p-=3; p++; P--;
·subtract a pointer from a pointer of the same type,
get the difference in the subscripts of the two elements. So, the resulting type isn't a pointer but is a signed integer type.

(5)Comparison

·The two pointers point to the same array of variables can be greater than, less than, equal to the comparison operator.
·Compared with Zero,p==0 means point to NULL。

Monday, January 11, 2010

Create an IRC account and login

Create an IRC account and login

1. google search "ChatZilla", download and install it.
2. From "FireFox"=>"Tools" => select "ChatZilla".
3. commands:
/server irc.freenode.net /* connect to server */
/join #seneca" /* join #Seneca channel */
/nick nickname /* Change your nickname */
/leave /* leave the channel */
/query nickname /* open a private chat with some one */

Enjoy!