my dog learned polymorphism*
The moose likes C / C++ and the fly likes I want a char pointer to point to a string entered by user at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Languages » C / C++
Bookmark "I want a char pointer to point to a string entered by user at runtime" Watch "I want a char pointer to point to a string entered by user at runtime" New topic
Author

I want a char pointer to point to a string entered by user at runtime

Mahtab Alam
Ranch Hand

Joined: Mar 28, 2012
Posts: 222

This is my code



But its not working , How to do that.


Oracle Java Programmer , Oracle SQL Expert
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38041
    
  22
Try this stackoverflow link. You need to give the pointer a length before you can read anything into it.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: I want a char pointer to point to a string entered by user at runtime
 
Similar Threads
Runtime.getRuntime().exec("sh export LC_ALL=C") fails!!!!!!!!!!
How the pointer represent in the case of String and Char
Only fun forwards for fun ...
How to use excel file in C program for file handeling?
Help with my first Objective-C class