| | |
converting from string to char*
![]() |
I want to find the length of a string, But the strlen function seems only to work with chars. I can't use a char[] to store my text because the size must be known beforehand and I don't know it. So I read everything into a string, then tried to convert it to a char like this.
This gives an error that expects a comma or semi-colon before 'char'..
How can I convert from string to char*? and if there is no way to do this, can anyone think of another way of counting the no. of characters in a trie structure aside from reading everything into a string and getting the length of it as I am trying to do?
C Syntax (Toggle Plain Text)
string count; char* count1=(char*(count));
This gives an error that expects a comma or semi-colon before 'char'..
How can I convert from string to char*? and if there is no way to do this, can anyone think of another way of counting the no. of characters in a trie structure aside from reading everything into a string and getting the length of it as I am trying to do?
![]() |
Similar Threads
- String to char* conversion (C++)
- string and char functions (C)
- Converting String* to char* (C)
- converting double to string (Java)
- Converting Int to Const Char (C)
Other Threads in the C Forum
- Previous Thread: Signal Processing: Hadamard Matrices
- Next Thread: Please help! Sudoku in C
| Thread Tools | Search this Thread |
#include * adobe ansi array asterisks binarysearch centimeter changingto char character cm convert copyimagefile cprogramme creafecopyofanytypeoffileinc database dynamic execv feet fgets file floatingpointvalidation fork function getlogicaldrivestrin givemetehcodez global grade gtkwinlinux hacking histogram ide inches include incrementoperators infiniteloop input interest intmain() iso kernel keyboard kilometer license linked linkedlist linux list locate looping lowest match matrix meter microsoft number oddnumber opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc process program programming radix recursion recv recvblocked research reversing segmentationfault sequential single socket socketprograming socketprogramming standard strchr string suggestions systemcall test threads turboc unix urboc user variable voidmain() wab whythiscodecausesegmentationfault windowsapi






