Timeline for sizeof char* array in C/C++
Current License: CC BY-SA 3.0
20 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 2, 2022 at 23:59 | comment | added | skittlebiz | I'm reiterating previous comments, but really guy @Abalieno? Not including the definition of sampleString? Can this question be archived/removed so that it doesn't appear as a possible solution for people with similar questions as myself just to find a fractured question body? Wasteful of time. | |
| Sep 10, 2012 at 17:56 | vote | accept | Abalieno | ||
| Sep 10, 2012 at 17:54 | comment | added | Abalieno | Solved my problem by converting to C++ string: std::string cppstring(samplestring); stringlength = cppstring.size(); | |
| Sep 10, 2012 at 15:05 | vote | accept | Abalieno | ||
| Sep 10, 2012 at 17:56 | |||||
| Sep 10, 2012 at 15:03 | review | Close votes | |||
| Sep 15, 2012 at 3:04 | |||||
| Sep 10, 2012 at 15:03 | comment | added | Bo Persson | possible duplicate of C++: sizeof for array length | |
| Sep 10, 2012 at 15:02 | comment | added | user3458 | In C++, char * is not the same as std:string, nor is it same as Java's String or python strings. If you want to understand char *, please start with K&R C - literally read K&R book. Otherwise, stay with std::string - it may keep you safe for a while. | |
| Sep 10, 2012 at 14:54 | history | edited | Abalieno | CC BY-SA 3.0 |
added 377 characters in body
|
| Sep 10, 2012 at 14:49 | answer | added | Praetorian | timeline score: 5 | |
| Sep 10, 2012 at 14:48 | answer | added | Mike Seymour | timeline score: 3 | |
| Sep 10, 2012 at 14:43 | answer | added | Mark Ransom | timeline score: 5 | |
| Sep 10, 2012 at 14:42 | answer | added | Minion91 | timeline score: 0 | |
| Sep 10, 2012 at 14:41 | comment | added | huseyin tugrul buyukisik | string is a char array isnt it? *p gives the first element if it is an array. You need a wrapper class to get size more correctly. I think your array is qwe+NULL | |
| Sep 10, 2012 at 14:41 | answer | added | Tristram Gräbener | timeline score: 0 | |
| Sep 10, 2012 at 14:40 | comment | added | user3458 | You managed to leave out the most important piece of info! | |
| Sep 10, 2012 at 14:40 | answer | added | Luchian Grigore | timeline score: 16 | |
| Sep 10, 2012 at 14:40 | history | edited | phoxis | CC BY-SA 3.0 |
added 12 characters in body
|
| Sep 10, 2012 at 14:39 | comment | added | phoxis |
where is the definition of samplestring ?
|
|
| Sep 10, 2012 at 14:39 | comment | added | Coding Mash |
how is samplestring declared?
|
|
| Sep 10, 2012 at 14:39 | history | asked | Abalieno | CC BY-SA 3.0 |