Solved

Builder 3 - Getting data input from user, Tedit

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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 …
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 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 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.

771 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

11 Experts available now in Live!

Get 1:1 Help Now