Article View: be.comp.programming
Article #3715Re: pointer naar table
From: Toni Van Remortel
Date: Wed, 12 Nov 2003 15:54
Date: Wed, 12 Nov 2003 15:54
48 lines
2641 bytes
2641 bytes
Op Wed, 12 Nov 2003 15:27:47 +0000, schreef Luc Kumps :
> Toni Van Remortel wrote:
>> Op Wed, 12 Nov 2003 13:50:48 +0000, schreef Luc Kumps :
>>
>>> typedef int tabletype[360][5];
>>> tabletype table_project;
>>> tabletype table_calculate;
>>> tabletype *project_table;
>>> project_table = &table_project;
>>
>> Heel bruikbaar.
>>
>> Nog een vraagje:
>> Kan ik die [5] vervangen door een struct? Dus zodanig dat ik een
>> array van struct heb?
>
> struct myStruct {
> int a,b,c,d,e;
> };
> typedef struct myStruct tabletype[360];
>
> // Luc K
OK, alvast merci voor de info, maar ik zit nu met het volgende:
typedef struct laserpoint
{ u8 x,y,signx,signy,onoff;
} tabletype[POINTS_PER_REV];
tabletype table_project; // the project table
tabletype table_calculate; // the calculate table
tabletype *p_project; // project pointer
tabletype *p_calculate; // calculate pointer
p_project = &table_project;
p_calculate = &table_calculate;
(*p_calculate)[i].x = (u8)(x*63.0) & 0x3F;
Op die laatste lijn geeft de compiler:
invalid type argument of `unary *'
Ik vermoed dat het een restrictie is van de compilatie (het is een Linux
kernel module). Of maak ik toch ergens een fout?
--
Groeten, Toni Van Remortel
Wetenschappelijk medewerker, D-science lab, Hogeschool Antwerpen
Real time Linux for embedded systems: http://linemb.d-sciencelab.com
Technical Details
Message-ID:
<pan.2003.11.12.15.56.20.559629@ha.be.invalid>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mailReferences:
<pan.2003.11.12.12.42.57.56187@ha.be.invalid> <YUqsb.19601$D02.281661@phobos.telenet-ops.be> <pan.2003.11.12.15.15.47.20613@ha.be.invalid> <Tjssb.19703$z04.492665@phobos.telenet-ops.be>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcea4,64ee87e359b9e07d X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-11-12 07:54:49 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!skynet.be!skynet.be!ossa.telenet-ops.be!phobos.telenet-ops.be.POSTED!not-for-mail From: "Toni Van Remortel" <t.vanremortel@ha.be.invalid> Subject: Re: pointer naar table User-Agent: Pan/0.13.3 (That cat's something I can't explain) Message-ID: <pan.2003.11.12.15.56.20.559629@ha.be.invalid> Newsgroups: be.comp.programming References: <pan.2003.11.12.12.42.57.56187@ha.be.invalid> <YUqsb.19601$D02.281661@phobos.telenet-ops.be> <pan.2003.11.12.15.15.47.20613@ha.be.invalid> <Tjssb.19703$z04.492665@phobos.telenet-ops.be> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit Lines: 49 Date: Wed, 12 Nov 2003 15:54:49 GMT NNTP-Posting-Host: 213.118.10.129 X-Complaints-To: abuse@telenet.be X-Trace: phobos.telenet-ops.be 1068652489 213.118.10.129 (Wed, 12 Nov 2003 16:54:49 MET) NNTP-Posting-Date: Wed, 12 Nov 2003 16:54:49 MET Organization: Telenet Internet