🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #9168

Re: Problemas con caracteres.

#9168
From: Antonio
Date: Fri, 30 Aug 2002 23:06
33 lines
2163 bytes
> #include <stdio.h>
> 
> main()
> {
>      int i,b,valor;
>      char frase[200];
>      char letras[]={'a','b','c','d','e','f','g',
>                     'h','i','j','k','l','m','n',
>                     'o','p','q','r','s','t','u',
>                     'v','w','j','y','z',' ','?'};
> 
>      char *morse[]={".-","-...","-.-.","-..",".","��-�","--�",
>                     "����","��","�---","-�-","�-��","--","-�",
>                     "---","�--�","--�-","�-�","���","-",
>      "��-","���-","�--","-��-","-�--","--��","\t","��--��"};
> 
>      fgets(frase,200,stdin);
>      printf("\n\n");
>      for(i=0;i<strlen(frase)-1;i++) {
>          for(b=0;b<27;b++) {
>              if(frase[i]==letras[b]) {
>                  printf("%s ",morse[b]);
>              }
>          }
>      }
>      printf("\n\n");
> }

Observa a parte que en la variable letras, donde debaria haber una 'x' 
aparece una 'j'.
De parte aprovecho para preguntarte por que has definido la variable morse 
como puntero?
Technical Details
Message-ID: <akouh1$g6e$1@reader2.wnet>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail
References: <3D6FBE6D.6090200@lycos.es>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,44ee7efd783c31d1
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2002-08-30 16:22:21 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.icl.net!newsfeed.fjserv.net!opentransit.net!newsfeed.comtenidos.com!newsfeeder.wanadoo.es!not-for-mail
From: Antonio <aperlu@obelix.umh.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Problemas con caracteres.
Date: Sat, 31 Aug 2002 01:06:52 +0200
Organization: Wanadoo
Lines: 37
Message-ID: <akouh1$g6e$1@reader2.wnet>
References: <3D6FBE6D.6090200@lycos.es>
NNTP-Posting-Host: 62-36-187-232.dialup.uni2.es
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8Bit
X-Trace: reader2.wnet 1030749538 16590 62.36.187.232 (30 Aug 2002 23:18:58 GMT)
X-Complaints-To: usenet@wanadoo.es
NNTP-Posting-Date: Fri, 30 Aug 2002 23:18:58 +0000 (UTC)
User-Agent: KNode/0.7.1