Re: [Dev-C++] Converting types(How to do it?)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Matthews <dem...@uw...> - 2003-05-12 02:23:55
|
If it's a char, then you can just use atoi([var]) or (int)[var]+1. I'm wondering what your database field is though. If it's like MySQL, then every field returned is a string value, in which case you'd use something like this: int val =3D atoi(returned_field)+1; You'd have to have your own updating code, as your description doesn't give much to go by. At 10:51 AM 11/05/2003 +0100, Daniel Glenfield wrote: >I'm interested to know why you would add 1 to a char, but you can convert= =20 >using atoi() > >it's something like > >int Buffer[10]; // create a buffer >atoi(Buffer, StringName, 10); // Where to store the int, your string to= =20 >convert, and the base type (10 for decimal). > >Do a search on google or msdn. > > >>From: "Fernando Correa da Concei;=E1o" <fer...@te...> >>To: dev...@li... >>Subject: [Dev-C++] Converting types(How to do it?) >>Date: Sat, 10 May 2003 17:08:29 -0300 >> >>Hi! >>I=B4m trying to use a database, but I need this, I have a field(a year by= =20 >>example), it=B4s a char. >>What I need is convert it to an int, add +1 and convert again to char. >> >>Thanks! >> >> >> >>------------------------------------------------------- >>Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara >>The only event dedicated to issues related to Linux enterprise solutions >>www.enterpriselinuxforum.com >> >>_______________________________________________ >>Dev-cpp-users mailing list >>Dev...@li... >>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >_________________________________________________________________ >Worried what your kids see online? Protect them better with MSN 8=20 >http://join.msn.com/?page=3Dfeatures/parental&pgmarket=3Den-gb&XAPID=3D186&= DI=3D1059 > > > >------------------------------------------------------- >Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara >The only event dedicated to issues related to Linux enterprise solutions >www.enterpriselinuxforum.com > >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |