Click here to Skip to main content
15,902,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: What is wrong in this strcpy()? Pin
auralius manurung23-Sep-08 7:43
auralius manurung23-Sep-08 7:43 
AnswerRe: What is wrong in this strcpy()? Pin
David Crow22-Sep-08 3:05
David Crow22-Sep-08 3:05 
AnswerRe: What is wrong in this strcpy()? Pin
Member 419459322-Sep-08 8:31
Member 419459322-Sep-08 8:31 
AnswerRe: What is wrong in this strcpy()? Pin
Mahesh Kulkarni22-Sep-08 20:34
Mahesh Kulkarni22-Sep-08 20:34 
QuestionAccessing a Variable from another function. Pin
T.RATHA KRISHNAN22-Sep-08 0:19
T.RATHA KRISHNAN22-Sep-08 0:19 
AnswerRe: Accessing a Variable from another function. Pin
CPallini22-Sep-08 0:26
mveCPallini22-Sep-08 0:26 
QuestionRe: Accessing a Variable from another function. Pin
T.RATHA KRISHNAN22-Sep-08 0:46
T.RATHA KRISHNAN22-Sep-08 0:46 
AnswerRe: Accessing a Variable from another function. Pin
CPallini22-Sep-08 1:41
mveCPallini22-Sep-08 1:41 
Probably I didn't get you. Anyway the following simple snippet possibly may help.
class A
{
  int * _p;
public:
  A(){ _p = NULL;}
  void fun1() { _p = new int; *_p = 10; }
  void fun2() 
  {
    if (_p) 
      printf("%d\n", *_p);
    else
      printf("_p is not initialized\n");
  }
  ~A(){if (_p) delete _p;}
};

void main()
{
 A a;
 a.fun2();
 a.fun1();
 a.fun2();
}



Smile | :)

If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.

This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke

[My articles]

AnswerRe: Accessing a Variable from another function. Pin
_AnsHUMAN_ 22-Sep-08 0:27
_AnsHUMAN_ 22-Sep-08 0:27 
QuestionDifference b/w strlen(NULL) and strlen("") Pin
SRKSHOME22-Sep-08 0:18
SRKSHOME22-Sep-08 0:18 
AnswerRe: Difference b/w strlen(NULL) and strlen("") Pin
CPallini22-Sep-08 0:23
mveCPallini22-Sep-08 0:23 
AnswerRe: Difference b/w strlen(NULL) and strlen("") Pin
toxcct22-Sep-08 21:30
toxcct22-Sep-08 21:30 
Questionoption button in tree control Pin
VCProgrammer21-Sep-08 23:37
VCProgrammer21-Sep-08 23:37 
Questionhow to create and run a webserver in VC++(MFC) Pin
tns_ranjith21-Sep-08 23:32
tns_ranjith21-Sep-08 23:32 
RantRe: how to create and run a webserver in VC++(MFC) Pin
Rajesh R Subramanian22-Sep-08 0:10
professionalRajesh R Subramanian22-Sep-08 0:10 
AnswerRe: how to create and run a webserver in VC++(MFC) Pin
enhzflep22-Sep-08 0:36
enhzflep22-Sep-08 0:36 
AnswerRe: how to create and run a webserver in VC++(MFC) Pin
Mark Salsbery22-Sep-08 5:53
Mark Salsbery22-Sep-08 5:53 
QuestionSetWindowPos don't accept values Pin
baerten21-Sep-08 23:31
baerten21-Sep-08 23:31 
AnswerRe: SetWindowPos don't accept values Pin
SandipG 21-Sep-08 23:58
SandipG 21-Sep-08 23:58 
GeneralRe: SetWindowPos don't accept values Pin
baerten22-Sep-08 4:23
baerten22-Sep-08 4:23 
QuestionRe: SetWindowPos don't accept values Pin
Mark Salsbery22-Sep-08 5:37
Mark Salsbery22-Sep-08 5:37 
QuestionCopy Byte information to structure Pin
nitin321-Sep-08 23:29
nitin321-Sep-08 23:29 
AnswerRe: Copy Byte information to structure Pin
SandipG 21-Sep-08 23:50
SandipG 21-Sep-08 23:50 
AnswerRe: Copy Byte information to structure Pin
CPallini21-Sep-08 23:53
mveCPallini21-Sep-08 23:53 
AnswerRe: Copy Byte information to structure Pin
Alan Balkany22-Sep-08 3:55
Alan Balkany22-Sep-08 3:55 

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.