problem about char-pointer-Collection of common programming errors


  • Torhan Bartel
    c arrays strtok char-pointer
    I have problems getting following Code to work. It parses a users input into a char*[] and returns it. However the char* command[] does not accept any values and stays filled with NULL… whats going

  • Brandon
    c++ access-violation char-pointer
    I’m probably doing something stupid here, but it’s been a while since I’ve worked in C++ and for some reason I keep getting an access violation when sprintf i

  • octopusgrabbus
    c memory-management char-pointer
    After writing a program to reverse a string, I am having trouble understanding why I got a seg fault while trying to reverse the string. I have listed my program below.#include #include #include void reverse(char *);int main() {char *str = calloc(1,’\0′);strcpy(str,”mystring0123456789″);reverse(str);print

  • Kacy Raye
    c++ arrays char-pointer
    So I’d like to say I know Java pretty well, and now I’m slowly but surely learning C++ so please bare with me because I’m sure this is a tr

  • Jace
    c++ stringstream uint64 char-pointer
    I’m working on a game and I ran into a strange little issue… I was wondering if anyone here would be able to figure this out and explain it to me (it’s eating me up!)Firstly, here’s the relevant code.// even if this data is not set, it returns “” // so it’s pretty much never null // but if the function returns something, // it will be the string representation of a 64bit unsigned int const char* c_KickID = GetGameData(“kick_member_id”);//gets my ID, works fine. unsigned long long myID = GetMyID();if(c_KickID != NULL) {//here i convert it to a unsigned 64-bit intunsigned long long kickID;std::stringstream ss(c_KickID);ss

  • Joce
    c++ cstring strcmp char-pointer
    I am having understanding a weird behavior of strcmp function, which will be illustrated by the following code:#include #include using namespace std;int main() {char *p = “no”;cout

Originally posted 2013-11-09 19:44:25.