not accesible

hi everyone

button.h
1
2
3
4
    private:
    ....
    ....
    std::string mTitle;


button.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
    //everything writes here is in one function
    ....
    ....
    mTitle = btnTitle;
    ....
    ....
    for(unsigned int i = 0; i <= mTitle.length(); i++)
    //inside for it gives SIGSEGV error and the debugger says
    //                    mTitle | <not accessible> | std::string
    {
        ....
    }
    ....


what might be the problem

if you need any further info i will provide it. the class and the function is so big so i didnt add everything here. just say if you need more of inside class

thx in advance
Last edited on
#include<string> ?
certainly not forgotten and i use c++ string class <string>

it woud give a compiler error before compiling if that would be the case
Last edited on
when i changed
for(unsigned int i = 0; i <= mTitle.length(); i++) to
1
2
int count = mTitle.length();
for(unsigned int i = 0; i <= count; i++)


it works fine. is it something problematic to get a class variable over and over again??
Last edited on
also at here
1
2
3
4
5
6
for(unsigned int i = 0; i <= mTitle.length(); i++)
    //inside for it gives SIGSEGV error and the debugger says
    //                    mTitle | <not accessible> | std::string
    {
        ....
    }


debugger says
i
is equal to
2
when it crashes
ok. i found out that something i created in class overrides
mTitle
and when i fixed it now everything is fine

thx for your helps anyway
Topic archived. No new replies allowed.