Questions tagged [qualifiers]

A qualifier adds an extra "quality", such as specifying volatility or constness of a variable

They're similar to adjectives: "a fickle man", "a volatile int", "an incorruptible lady", "a const double". With or without a qualifier, the variable itself still occupies the same amount of memory, and each bit has the same interpretation or contribution to the state/value. Qualifiers just specify something about how it may be accessed or where it is stored

Credits goes to Tony_D @ What is the meaning of "qualifier"?

211 questions
2
votes
1 answer

How to use a const C struct when the super-struct refers to a non-const?

Consider the following example: typedef struct Collection { ... } Collection; typedef struct Iterator { Collection* collection; } Iterator; Iterator is to offer collection-modifying functions, hence it holds address of a non-const…
user2231
  • 21
  • 2
2
votes
1 answer

Order of const and volatile for a variable

The following piece of code compiles and runs with gcc version 4.7.2 (Debian 4.7.2-5) : #include int main() { const volatile x = 3; volatile const y = 4; return 0; } Should I assume that the order of const and volatile is…
baibo
  • 448
  • 4
  • 20
2
votes
4 answers

c++ - difference between const and static keyword in function header

Consider the following code: class Test { public: //1 int kon1() const; //2 const int kon2(); //3 static int kon3(); }; As far as I know, the difference between function 1 and 2 is that : Function 1 says that the function will…
William
  • 51
  • 1
  • 5
2
votes
2 answers

Android dpi ice cream sandwich problems

I have two values folders: values values-sw320dp I ran the application on a device with Ice Cream Sandwich. Despite the device has a 240 dpi display, it reads values from the values-sw320dp folder, rather then values folder.
user3278732
  • 1,694
  • 10
  • 31
  • 67
2
votes
1 answer

Android: Multiple screen layout

I am having problem creating layout for different devices. The old qualifier example small, normal and large, xlarge etc.. My layout is very simple. I just want the whole interface keep the same through different devices... From the android website…
LittleFunny
  • 8,155
  • 15
  • 87
  • 198
2
votes
1 answer

Error passing arguments to template function with const qualifier

I have this code example: #include #include template void func1(T& value) { std::cout << "passed 1 ..." << std::endl; } template