Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


string2char *  needhelp,now

Posted on 1999-07-24
Medium Priority
Last Modified: 2008-03-06
i've got problem
i'm trying to open file(i've got array of strings with filenames),file opens,but name is name i need+some stuff(?)
the code is:

char* buf = new char[fnames[k].length()];
names[k].copy(buf, fnames[k].length());
delete buf;

What i did wrong and what i should do to solve the problem
And in other part of code i also need to translate from string to char* and there i've go the same problem
for example,if file name(fname[k]) is "stel.txt"
i've got stel.htmÌÏÙ×ÔÌÏÁÐÒ
Can somebody help me?
Question remains actual for some ours(maimum day)
Question by:mattdaimon
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 10

Accepted Solution

viktornet earned 120 total points
ID: 1200967
try this...


that should do it...


Author Comment

ID: 1200968
Thanks a lot
you were really fast
LVL 10

Expert Comment

ID: 1200969
hehe, no problem :)

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question