From 1869838023839359227
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,6890a393d5a6e62d
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-07-27 23:24:04 PST
Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!shom.fr!news.univ-rennes1.fr!cribx1.u-bordeaux.fr!victor!bernard
From: bernard@victor (BERNARD Sebastien [93-94])
Newsgroups: comp.std.c++
Subject: Re: Urgent! Help in string handling
Date: 28 Jul 1994 05:02:20 GMT
Organization: Laboratoire Bordelais de Recherche en Informatique
Lines: 39
Message-ID: <317e4s$dna@serveur.cribx1.u-bordeaux.fr>
References: <CtLLnD.64D@aston.ac.uk>
NNTP-Posting-Host: victor.labri.u-bordeaux.fr
X-Newsreader: TIN [version 1.2 PL2]

N ANTONOPOULOS (antonopn@aston.ac.uk) wrote:
: Hello everybody,
:       I am develloping  a Graphical User Interface in X-Windows using C++.
: I have to finish my program by the beginning of august. I have the following
: problem :
:       If we have a float variable ie a which holds the value lets say 12.34
: how can i create a char pointer which will point to the string "12.34" ?
: It would be extremely important for me if i could get an answer as soon as
: possible.

Well :
#include <iostream.h>
#include <strstream.h>

main()
{
  float a = 12.34;
  char *toto;
  ostrstream TheStr;

  TheStr << a;

  toto = TheStr.str();

  cout << toto;
  return 0;
}

That's all I have to say.

: Thanks very much in advance.

: Moto:
: As computer scientist i am in total control of my experiments.
: Nick Antonopoulos
: e-mail: antonopn@aston.ac.uk





