?
Solved

Builder 3 - Getting data input from user, Tedit

Posted on 1998-12-20
1
Medium Priority
?
294 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
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.
Suggested Courses

765 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