Article View: fr.comp.lang.c
Article #15500Re: memcpy et char
From: Emmanuel Delahaye
Date: Fri, 23 Sep 2005 15:42
Date: Fri, 23 Sep 2005 15:42
44 lines
1833 bytes
1833 bytes
Targeur fou wrote on 23/09/05 :
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <ctype.h>
>
> int isCharValid(char c)
> {
> return ( (isdigit(c) || c == '.' || c == ',') ? 1 : 0 );
COmpliqu�...
return (isdigit(c) || c == '.' || c == ',');
> }
>
> /**
> * comma2dot
> * Remplace la virgule par le point comme s�parateur dans une chaine
> num�rique
> * @param[in] s chaine � traiter
> * @return rc
> * 0 : succes
> * -1 : argument nul
> * -2 : pb allocation
> * -3 : chaine fournie non valide
> */
> int comma2dot(char * s)
> {
> int rc = 0;
>
> if (s != NULL) {
>
> size_t lg = strlen(s);
> char * tmp = malloc(lg+1);
Ca fout la trouille!
--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html
.sig under repair
Technical Details
Message-ID:
<mn.bc267d590261c670.15512@YOURBRAnoos.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!proxad.net!infeed-4.proxad.net!news18-e.free.fr!not-for-mailReferences:
<4333e995$0$17469$626a14ce@news.free.fr> <1127484266.226712.264720@g49g2000cwa.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,366ad66ae342f8da X-Google-Attributes: gidf9822,public X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!proxad.net!infeed-4.proxad.net!news18-e.free.fr!not-for-mail Subject: Re: memcpy et char From: "Emmanuel Delahaye" <emdel@YOURBRAnoos.fr> References: <4333e995$0$17469$626a14ce@news.free.fr> <1127484266.226712.264720@g49g2000cwa.googlegroups.com> Newsgroups: fr.comp.lang.c Message-ID: <mn.bc267d590261c670.15512@YOURBRAnoos.fr> X-Newsreader: MesNews/1.04.00.00-fr Date: Fri, 23 Sep 2005 17:42:50 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; format=flowed Content-Transfer-Encoding: 8bit Lines: 46 Organization: Guest of ProXad - France NNTP-Posting-Date: 23 Sep 2005 17:42:51 MEST NNTP-Posting-Host: 81.65.109.78 X-Trace: 1127490171 news18-e.free.fr 18851 81.65.109.78:16427 X-Complaints-To: abuse@proxad.net