Solved

Builder 3 - Getting data input from user, Tedit

Posted on 1998-12-20
1
289 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
1 Comment
 

Accepted Solution

by:
plsbctv earned 10 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MSVCR80.dll crash 2 134
Would like to move button in a function 3 72
Using Diagnostic tools in VS2015: Unresoved allocations 19 65
gdb doesn't stop on breakpoint 2 50
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now