Click here to Skip to main content
15,909,051 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to get Active Application or File name? Pin
SNI9-Mar-09 21:35
SNI9-Mar-09 21:35 
AnswerRe: How to get Active Application or File name? Pin
Hamid_RT9-Mar-09 21:43
Hamid_RT9-Mar-09 21:43 
GeneralRe: How to get Active Application or File name? Pin
SNI9-Mar-09 23:13
SNI9-Mar-09 23:13 
GeneralRe: How to get Active Application or File name? Pin
ShiXiangYang9-Mar-09 23:25
ShiXiangYang9-Mar-09 23:25 
GeneralRe: How to get Active Application or File name? Pin
alphaxz10-Mar-09 23:24
alphaxz10-Mar-09 23:24 
GeneralRe: How to get Active Application or File name? Pin
Hamid_RT11-Mar-09 2:54
Hamid_RT11-Mar-09 2:54 
GeneralRe: How to get Active Application or File name? Pin
alphaxz12-Mar-09 15:23
alphaxz12-Mar-09 15:23 
QuestionHome-made string constructor Pin
aab199029-Mar-09 21:34
aab199029-Mar-09 21:34 
I have to construct a class for strings. C++ already has one, but my assignment is a home-made version. I am very lost as to how to make the constructor work. I have toyed with a few things, but I was given a header file to follow and I have no clue what to do. Any help would be appreciated.

class String
{
  private:

    unsigned Capacity;  // Number of memory locations reserved
    unsigned Length;    // Number of memory locations in use
    char * Mem;         // Pointer to memory to hold characters

  public:

    // Construct empty string
    //
    String()
    {
      Mem = NULL;
      Capacity = 0;
      Length = 0;
    }


A few specific questions I have:

How are the Mem, Capacity, and Length relavent? After reading the assignment but before looking at the header file I thought i was going to construct a string by taking the sizeof() of the string then applying an array of char[].

I do not see the point of reserving memory for a string when you already know how much space to save...In simpler words I see no point in having a Capacity and a length?
AnswerRe: Home-made string constructor Pin
Cedric Moonen9-Mar-09 22:44
Cedric Moonen9-Mar-09 22:44 
AnswerRe: Home-made string constructor Pin
KarstenK10-Mar-09 0:14
mveKarstenK10-Mar-09 0:14 
AnswerRe: Home-made string constructor Pin
David Crow10-Mar-09 4:07
David Crow10-Mar-09 4:07 
Questionsoftware not working in vista which work properly in xp. Pin
somnathjagtap9-Mar-09 21:32
somnathjagtap9-Mar-09 21:32 
AnswerRe: software not working in vista which work properly in xp. Pin
Hamid_RT9-Mar-09 21:46
Hamid_RT9-Mar-09 21:46 
GeneralRe: software not working in vista which work properly in xp. Pin
somnathjagtap9-Mar-09 22:25
somnathjagtap9-Mar-09 22:25 
AnswerRe: software not working in vista which work properly in xp. Pin
KarstenK9-Mar-09 22:36
mveKarstenK9-Mar-09 22:36 
GeneralRe: software not working in vista which work properly in xp. Pin
somnathjagtap9-Mar-09 22:56
somnathjagtap9-Mar-09 22:56 
GeneralRe: software not working in vista which work properly in xp. Pin
KarstenK10-Mar-09 0:09
mveKarstenK10-Mar-09 0:09 
Questionimport data from excel file Pin
trioum9-Mar-09 21:30
trioum9-Mar-09 21:30 
AnswerRe: import data from excel file Pin
Cedric Moonen9-Mar-09 21:39
Cedric Moonen9-Mar-09 21:39 
GeneralRe: import data from excel file Pin
trioum9-Mar-09 21:50
trioum9-Mar-09 21:50 
GeneralRe: import data from excel file Pin
Paresh Chitte10-Mar-09 0:29
Paresh Chitte10-Mar-09 0:29 
GeneralRe: import data from excel file Pin
David Crow10-Mar-09 4:09
David Crow10-Mar-09 4:09 
QuestionHide the cmd window using createprocess function Pin
raj15769-Mar-09 21:07
raj15769-Mar-09 21:07 
AnswerRe: Hide the cmd window using createprocess function Pin
0x3c09-Mar-09 21:17
0x3c09-Mar-09 21:17 
GeneralRe: Hide the cmd window using createprocess function Pin
raj15769-Mar-09 21:27
raj15769-Mar-09 21:27 

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.