| | |
memory leak problem...
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2006
Posts: 78
Reputation:
Solved Threads: 0
•
•
•
•
Originally Posted by Salem
the variable m_pMatriz is double* and the GetElement and SetElement are methods for CMatrix types
But those functions take and return doubles, so there should be no problem.
They're used fine in some contexts already anyway.
I've attached your code with Set/Get used in many more places, and it compiles fine here.
The //!! comments are what my g++ compiler spotted with
$ g++ -c -W -Wall -ansi -pedantic -O2 foo.cpp

•
•
•
•
Originally Posted by Salem
Oh, you might want to rename all your loop variables from i,j to be say r,c to denote row and column. It's not always clear whether you're accessing the correct element of the array (when you're doing it directly), and r/c would make it more readable IMO.
•
•
•
•
Originally Posted by Salem
At least by always using the set/get functions, every access is properly range checked (as it should be).
I've tried to put the delete in some methods and commented the delete in the destructor, however wtihout sucess...
what do you suggest?
Sorry if I'm getting boring to you...
thanks
Last edited by Dave Sinkula; Jun 1st, 2006 at 2:48 pm. Reason: Added quote tags to help with my confusion.
![]() |
Similar Threads
Other Threads in the C Forum
- Previous Thread: How to handle #include & organize source files
- Next Thread: Question on terminologies
| Thread Tools | Search this Thread |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyanyfile copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h






