|
From: Per W. <pw...@ia...> - 2007-06-05 05:53:44
|
Don't try to write functions that return arrays. Note that in C/C++, a pointer and an array is alsmost the same thing from a language perspective. The array name is always returned as a pointer to the first element in the array... Exactly what problem are you trying to solve? Let the function return a pointer to a string, and let the receiver accept this string. Why do you care about an array size? /pwm On Mon, 4 Jun 2007 fa...@un... wrote: > --===============0082291564== > Content-Type: text/plain; > Content-Transfer-Encoding: quoted-printable > > Hi, everyone,=20 > I have a problem with a string of char function. I have define a typedef = > char cad[80], and i want a function that return a char[80] type, because = > in dev-c++ is not posible return this type a write the function to return= > a pointer to char[80], in de form *cad. But, i don't get the function re= > turn the desired cad, the compiler always tell me a mismatch in the type = > to return, and the type i work. In linux-unix compiler CPP i don=B4t have= > problems, but in the windows dev-c++ version ever i had a error, or a mo= > s match. > > I agree your sugestions. > > -------------------------------------- > MENSAJE ENVIADO CON WMAIL 1.01 > UNIVERSIDAD DEL CAUCA > > > > > --===============0082291564== > Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > --===============0082291564== > Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > --===============0082291564==-- > |