carray

Simple CArray questions

1.) What is the difference between CArray <SomeClass> collection; and CArray <SomeClass,SomeClass> collection; or even CArray <SomeClass* ,SomeClass* > collection; ? 2.) While reading some comments on Stackoverflow I came to a note saying "Don't use CArray". Why should CArray not be used? ...

How to sort a CArray of pointers?

As you might have already guessed I don't want to sort the pointer addresses but the objects/data. At the moment I have an array like this: CArray <ReadObject *> readCollecion; and I sort it like that: std::sort(readCollecion.GetData(), readCollecion.GetData()+readCollecion.GetSize(), keySortFunction); Works perfectly with the ke...

CArray doesn't call copy constructors on memory reallocations, now what?

Suppose I have a class that requires copy constructor to be called to make a correct copy of: struct CWeird { CWeird() { number = 47; target = &number; } CWeird(const CWeird &other) : number(other.number), target(&number) { } const CWeird& operator=(const CWeird &w) { number = w.number; return *this; } void output() ...

How to "replay" wireshark c-array in perl or C

How would one go about taking hex data into a program and sending it back out? char peer0_0[] = { 0x00, 0x00, 0x10, 0x01, 0xbf, 0x8b, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07 }; char peer0_1[] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 ...

problem returning CArray

Hi, I am trying to return CArray from a function and trying to call the function from another class short ListMaker::RetArray(CString szName, CArray<CString, CString&> &szarr_Names) { szarr_Names.Add(szName); return 0; } //////////// main() { .. CArray<CString, CString&> myArray; ListMaker LM; short nCode = LM.Re...

Array giving EXC_BAD_ACCESS in for loop

I have a C array defined in my method as: int c = 4; int r = 5; keysArray[c][r]; I have this for loop, which works, populating the keysArray as expected. for (int row = 0; row < r; row++) { for (int column = 0; column < c; column++){ keysArray[column][row] = [anotherArray objectAtIndex:0]; NSLog(@"array1 %@",keysA...