Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

function return struct -> Error: incompatible types in assignment

Altera_Forum
Honored Contributor II
898 Views

hey there  

 

its driving me nuts. to me it seams fine but the compiler complains. maybe somebody knows what i'm doing wrong. 

 

well i have a structure : 

typedef struct { long start; long end; }range; 

then there is a function: 

range get_range(int max) { range borders; : : return borders; } 

and my main program: 

: range borders; borders = get_range(1000); : 

right there where i try to assign the return value of "get_range" to "borders" i get the error from the compiler "incompatible types in assignment". 

 

thanks in advance 

rico
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
136 Views

Rico, 

 

Is there a prototype for get_range occurring somewhere before the use of it in the assignment? 

 

Bill
Altera_Forum
Honored Contributor II
136 Views

And so simple it is. The prototype was wrong. 

 

Thanks very much :)
Reply