Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

saravanaram

@saravanaram
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Memory Leak
    S saravanaram

    Hi all, in mfc dialog based application i have the following function. void Reverse() { // TODO: Add your control notification handler code here int nIndex, nStrLength, nWordIndex; TCHAR *pStrWord, *pStrFinal, ch; UpdateData(TRUE); nStrLength = m_strInput.GetLength(); pStrWord = new TCHAR [nStrLength + 1]; pStrFinal = new TCHAR [nStrLength + 1]; *pStrWord = '\0'; *pStrFinal = '\0'; nWordIndex = 0; for (nIndex = 0;nIndex < nStrLength; nIndex++) { ch = m_strInput.GetAt(nIndex); if ( ch != ' ' || nIndex == nStrLength ) { pStrWord[nWordIndex] = m_strInput.GetAt(nIndex); nWordIndex++; } if ( ch == ' ' ) { pStrWord[nWordIndex++] = ' '; pStrWord[nWordIndex] = '\0'; _tcscat(pStrFinal,_tcsrev(pStrWord)); nWordIndex=0; } if ( nIndex == (nStrLength - 1) ) { pStrWord[nWordIndex++] = ' '; pStrWord[nWordIndex] = '\0'; _tcscat(pStrFinal,_tcsrev(pStrWord)); nWordIndex = 0; } } pStrFinal = _tcsrev(pStrFinal); pStrFinal[nStrLength] = '\0'; m_strOutput = pStrFinal; UpdateData(FALSE); delete [] pStrWord; delete [] pStrFinal; } I get error when deleting pStrFinal could anyone tell me why this happens. can any one of you explain me how to dump memory and to verify it.

    C / C++ / MFC c++ performance help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups