suppose there is a string of characters in an array of d[20] . How to convert to a string d so that i can use it in string functions like strcmp..
views:
55answers:
3
+3
A:
It must be null-terminated. That's the only requirement. I presume you know how to do that.
Alex
2010-04-19 01:35:43
yup .. i do know how to do it
mekasperasky
2010-04-19 01:37:09
+1
A:
it's already something on which you can operate with standard string functions, assuming that it ends with '\0'
since it's a requirement: it needs to know when the string ends.
You can prepare the space of char[]
by memsetting it with memset(string, 0, length)
.
Jack
2010-04-19 01:36:31