Click here to Skip to main content
15,903,632 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: please can any one help me ???? Pin
FlyingTinman20-Jun-05 12:08
FlyingTinman20-Jun-05 12:08 
GeneralRe: please can any one help me ???? Pin
kosamoza20-Jun-05 13:57
kosamoza20-Jun-05 13:57 
Generalerror LNK2001: unresolved external symbol Pin
John R. Shaw19-Jun-05 13:31
John R. Shaw19-Jun-05 13:31 
GeneralRe: error LNK2001: unresolved external symbol Pin
PJ Arends19-Jun-05 14:46
professionalPJ Arends19-Jun-05 14:46 
GeneralRe: error LNK2001: unresolved external symbol Pin
John R. Shaw20-Jun-05 6:31
John R. Shaw20-Jun-05 6:31 
GeneralRe: error LNK2001: unresolved external symbol Pin
PJ Arends20-Jun-05 11:51
professionalPJ Arends20-Jun-05 11:51 
GeneralPortable Sockets Pin
wb18-Jun-05 20:59
wb18-Jun-05 20:59 
GeneralRe: Portable Sockets Pin
User 58385220-Jun-05 3:21
User 58385220-Jun-05 3:21 
QuestionHow to show the CAPS is on tooltip when focus on password textbox? Pin
Member 166300818-Jun-05 17:52
Member 166300818-Jun-05 17:52 
AnswerRe: How to show the CAPS is on tooltip when focus on password textbox? Pin
Nilesh K.19-Jun-05 18:02
Nilesh K.19-Jun-05 18:02 
GeneralTemplate class Pin
JohnZZ18-Jun-05 7:03
JohnZZ18-Jun-05 7:03 
GeneralRe: Template class Pin
S. Senthil Kumar18-Jun-05 7:40
S. Senthil Kumar18-Jun-05 7:40 
GeneralRe: Template class Pin
JohnZZ18-Jun-05 8:02
JohnZZ18-Jun-05 8:02 
GeneralRe: Template class Pin
John M. Drescher18-Jun-05 8:23
John M. Drescher18-Jun-05 8:23 
GeneralRe: Template class Pin
JohnZZ18-Jun-05 14:25
JohnZZ18-Jun-05 14:25 
GeneralRe: Template class Pin
John M. Drescher18-Jun-05 16:17
John M. Drescher18-Jun-05 16:17 
GeneralRe: Template class Pin
JohnZZ18-Jun-05 23:56
JohnZZ18-Jun-05 23:56 
GeneralRe: Template class Pin
John R. Shaw19-Jun-05 14:43
John R. Shaw19-Jun-05 14:43 
I do not have a solution but I have a suggestion. Use a vector as a class member to actualy hold the data (a lot of work went into make it efficient).

// Minor example
template<clas T> // T can be almost any type
class my_class
{
public:
    typedef std::vector<T> array_type;
    void resize(int d1,int d2)
    {
        unsigned new_size = abs(d1) + abs(d1);
        // It must be an odd number so that we
        // can have a center index value from which
        // to offset from.
        if( !(new_size & 1) )
            ++new_size;
        data_array.resize(new_size);
        center_index = new_size>>1;
    }
    const T& get_at(int index) // operator[] would call this
    {
        unsigned new_index = center_index + index;
        // This is probably not need, because
        // the vector class will probably throw an error.
        if( new_index >= data_array.size() )
            throw(range_error );
        data_array[new_index];
    }
protected:
    // Single dimension array
    array_type data_array;
    unsigned center_index.
};


The above has a long way to go before it meets your requirements, but it is a good place to begin.

Oh; by the way, the following will not work and will generate errors:

lowIndex = newLowIndex; // not know at runtime
highIndex = newHighIndex; // not know at runtime
double data[highIndex-lowIndex]; // therefor, this is an error


INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
GeneralSetFocus function Pin
volovik18-Jun-05 6:14
volovik18-Jun-05 6:14 
GeneralRe: SetFocus function Pin
John M. Drescher18-Jun-05 11:03
John M. Drescher18-Jun-05 11:03 
GeneralRe: SetFocus function Pin
PJ Arends18-Jun-05 11:33
professionalPJ Arends18-Jun-05 11:33 
GeneralRe: SetFocus function Pin
Toby Opferman18-Jun-05 13:53
Toby Opferman18-Jun-05 13:53 
GeneralRe: SetFocus function Pin
John M. Drescher18-Jun-05 16:19
John M. Drescher18-Jun-05 16:19 
GeneralRe: SetFocus function Pin
Toby Opferman18-Jun-05 19:42
Toby Opferman18-Jun-05 19:42 
Questionwhat are external dependencies? Pin
sayup18-Jun-05 2:52
sayup18-Jun-05 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.