🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: strcat() en c++

#7394
From: MA
Date: Wed, 05 Mar 2003 22:38
27 lines
1636 bytes
Edgar de la cruz wrote:
> Resulta que estaba haciendo el siguiente programilla en c++ en mi redhat 

Si realmente es C++, te recuerdo que el operador "+" est� sobrecargado 
para stringsm y char* promociona a string por string::string(char *).

No se si ser� esto lo que quieres...

En la practica, un ejemplo:

#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
         string s;
         for (int i=1;i<argc;i++)
           s=s+argv[i];
         cout<<"Concat: "<<s<<'\n';
}

--
Un saludo

Miguel Angel
Technical Details
Message-ID: <k8u54b.fq2.ln@linuxproxy.dmz.local>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!161.red-80-33-77.pooles.rima-tde.NET!not-for-mail
References: <b453rv$6ma$1@julieta.escomposlinux.org>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,aff69d8b36562df0
X-Google-Attributes: gidf86c8,public
X-Google-ArrivalTime: 2003-03-05 14:45:03 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!161.red-80-33-77.pooles.rima-tde.NET!not-for-mail
From: MA <pozosinfondo@hotmail.com>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: strcat() en c++
Date: Wed, 05 Mar 2003 23:38:13 +0100
Lines: 28
Message-ID: <k8u54b.fq2.ln@linuxproxy.dmz.local>
References: <b453rv$6ma$1@julieta.escomposlinux.org>
NNTP-Posting-Host: 161.red-80-33-77.pooles.rima-tde.net (80.33.77.161)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fu-berlin.de 1046904302 64223527 80.33.77.161 (16 [109588])
X-Orig-Path: linuxproxy.dmz.local!nobody
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210
X-Accept-Language: es, en, en-us
In-Reply-To: <b453rv$6ma$1@julieta.escomposlinux.org>