Re: table 位址的取得問題
|
||||
---|---|---|---|---|
中級會員
|
忘了補充,小弟是建立在rom上的array
並非ram上的array 上面高手回應的方式是用在ram上的方式 這個方式小弟有用過但行不通....
發表於: 2008/3/20 12:52
|
|||
|
Re: table 位址的取得問題
|
||||
---|---|---|---|---|
資深會員
|
unsigned char array[5] = {01,02,03,04,05};
unsigned char *ptr; ptr=array; //or ptr=&array[0];
發表於: 2008/3/20 11:56
|
|||
|
table 位址的取得問題
|
||||
---|---|---|---|---|
中級會員
|
有一程式建表,如: array[5] = {01,02,03,04,05};
小弟的問題是在如何以程式的描述取得 array[0]的address 因為小弟想讓array[0]的起始點由compiler決定,故它的 位址可能每次compiler都不一樣... 例如: x = &array[0]; 而 array[0] 的位址是 0x1234 故執行上式後 x 應該 0x1234 可是這樣的程式如何用C18描述呢? 範例中找不到...
發表於: 2008/3/20 9:46
|
|||
|