CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Feb 2006
    Posts
    9

    Not dropping core when referring out of bound address...

    Here's my prog running on solaris10.
    Code:
    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>
    struct ThshldActionStat
    {
        char        thshldAction[25];
    };
    
    const int MAX_THSHLDS_PER_GRP_CD = 50;
    typedef ThshldActionStat ThshldGroupActions[MAX_THSHLDS_PER_GRP_CD];
    
    int main()
    {
        ThshldGroupActions *thshldGroupActionStatsOver_;
        ThshldGroupActions *thshldGroupActionStatsUnder_;
    
        thshldGroupActionStatsOver_ = new ThshldGroupActions[55 + 1];
        thshldGroupActionStatsUnder_ = new ThshldGroupActions[55 + 1];
        int i,j;
        for ( i=0;i<59;i++ )
            for(j=0;j<67;j++)
            {
                strcpy( thshldGroupActionStatsOver_[i][j].thshldAction, "" );
                strcpy( thshldGroupActionStatsUnder_[i][j].thshldAction, "" );
            }
        return 0;
    }
    It is running fine... which should drop core in general....
    Can some one please help me here to say what's happening here?

    Thx in advance!
    Last edited by Ejaz; June 23rd, 2008 at 07:27 AM. Reason: Code tags added

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured