[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Builder 3 - Getting data input from user, Tedit

Posted on 1998-12-20
1
Medium Priority
?
296 Views
Last Modified: 2008-02-20
I am using Builder and have a problem getting data from the VCL, I want to do something like this, strcpy(name,Edit1->Text); this does not work but this does Edit2->Text = Edit1->Text; I need to initialise variable using the Tedit or other BCB3 component. In C++ I would have used cin>> or scanf();. I have tried searching for sample Code but have foound all the Sample Code Available mouse click driven with no real data comming  from the operator.
Can any one help me,

DAVID
0
Comment
Question by:dj1encore
[X]
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
1 Comment
 

Accepted Solution

by:
plsbctv earned 40 total points
ID: 1180687
I assume that name is declared as
  char name[...];
In other words, name is type char *.

strcpy (name,Edit1->Text)
fails because Edit1->Text is type AnsiString, not char *.

You can do this by writing

strcpy (name, (Edit1->Text).c_str());

    ++PLS

0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

650 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