Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
1
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
0 Endorsements
~3K People Reached
Favorite Forums
Favorite Tags
c++ x 11
c x 2

5 Posted Topics

Member Avatar for MacLeopard
Member Avatar for Ancient Dragon
0
897
Member Avatar for saishn

[code] #include <iostream> using std::cout; using std::endl; class aClass { public: aClass() { this->aString = new char [1];; this->aString[0] = '\0'; this->length = 0; } ~aClass() { cout << "Destructor" << endl; delete [] this->aString; } aClass(const char *); const aClass& aClass::operator=(aClass &); private: int length; char * aString; }; …

Member Avatar for saishn
1
109
Member Avatar for saishn

Again, I don't know what I've done wrong. [code] #include <iostream> using std::cout; using std::endl; #include <cstring> using std::strcpy; using std::strcat; #include <cstdio> using std::sprintf; void destroyMultiCharArray(char * * anArray, int size) { for (int i = 0; i < size; i++) { delete [] anArray[ i ]; } delete …

Member Avatar for saishn
0
304
Member Avatar for saishn

[code] #include <iostream> using std::cout; using std::endl; #include <cstring> using std::strcpy; using std::strcat; #include <cstdio> using std::sprintf; int main() { char * lb = "(?:[a-z90](?:-?[a-z90]+)+)"; int lbLen = strlen(lb); char * sbFrmat = "(?:%s(?:\\.%s){0,4})"; int sbFrmatLen = strlen(sbFrmat); int sbLen = (lbLen * 2) + sbFrmatLen; char sb[sbLen+1]; sprintf(sb, sbFrmat, …

Member Avatar for Ancient Dragon
0
241
Member Avatar for saishn

I get a segfault when I run the following. Seems to fail at strcpy. [code] #include <cstring> using std::strcpy; int main() { char * word = "word"; strcpy(word, "what"); } [/code] If I change char * word to char word[], it's fine. I thought that both declarations effectively do the …

Member Avatar for saishn
0
2K

The End.