digitalmars.D.learn - char/string count...?help me please..
- Pieter Valdano Pattiruhu (8/8) Jun 19 2007 dear senior,
- vermi (1/1) Jun 19 2007 you string is a char array ? Try array.length !
- pieter Valdano pattiruhu (14/15) Jun 19 2007 here is my count char program:
dear senior, my name is pieter from indonesia(an amateur person in D programming)... i just want to ask the syntax to count an input string from user... as we know in C we should use "strln"....how bout in D?. if don't mind please give me example a little piece of char/string count program... thank you for your attention...God Bless U always... nb: please reply to pieter_ambonese yahoo.co.id
Jun 19 2007
vermi Wrote:you string is a char array ? Try array.length !here is my count char program: import std.stdio; import std.string; void main() { char* s; char string[100]; writef("please input your text="); scanf("%s",&string); writef("your text length is=",string.length); } does my program work properly?. when i try to run it, d compiler tell that can't convert string to int. please show me the way to convert string into integer. (if you don't mind i need your correction in my simple char program). thank you very much...GBU
Jun 19 2007