Is there any way to only use one string-like variable (char[xyz] or string) in my code? Some things complain if I use a char[xyz], but not a string, others work the opposite way, and it would be easier to just use one type instead of converting back and forth.
Thanks.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=162874\"][{POST_SNAPBACK}][/a][/div]
sounds like QString is what you want
[div align=\"right\"][a href=\"index.php?act=findpost&pid=162881\"][{POST_SNAPBACK}][/a][/div]
I'm not using QT. Is that an issue?
Is it possible to just use either strings or character arrays?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=162882\"][{POST_SNAPBACK}][/a][/div]
I guess there is no easy way out but to convert them back and forth. Not too familiar with the string definition in QT3, but there might be some cast members that return a pointer from string that can be used as a char pointer in some functions.
Using MFC (Microsoft Foundation Classes) as an example,
CString sMyText;
char szMyText[100];
char * lpszMyText;
sMyText = "Some data here";
lpszMyText = sMyText.GetBuffer(sMyText.GetLength());
// Use lpszMyText
strcpy(szMyText, lpszMyText);
lpszMyText = NULL; // Not required but good practise to null the pointers
// Release buffer pointer
sMyText.ReleaseBuffer();
Hope this make sense.