- Rebar & Toolbar, odd behavior
I've got three functions to create a toolbar and a rebar, and one to insert bands HWND CreateToolBar(HWND hParentWindow) { TBBUTTON tbb[3]; TBADDBITMAP tbab; HWND hTool = CreateWindow(TOOLBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hParentWindo...
- Reassignment to a const variable that was declared in an if()
Hi,I thought that I understood how C++ allows for the declaration anddefining of variables within an if() statement and how the declaredvariable can be used until the end of the major if() block.if (int a = /*...*/) {// ...}else if (a = /*variable a be assigned*/) {/* variable a can still be use...
- reassigning value of a pointer
Hi all,In the following code I am trying to change the contents of a string:int main(){char *string="testing";rename(string);return 0;}void rename(char *s){printf("Character 1: %c\n",*s);*s='a';printf("Character 1 now: %c\n",*c);}Anyway, I am sure this is possible but for some reason I...
- reassigning value of a pointer
Hi all,In the following code I am trying to change the contents of a string:int main(){char *string="testing";rename(string);return 0;}void rename(char *s){printf("Character 1: %c\n",*s);*s='a';printf("Character 1 now: %c\n",*c);}Anyway, I am sure this is possible but for some reason I...
- reassigning value of a pointer
Hi all,In the following code I am trying to change the contents of a string:int main(){char *string="testing";rename(string);return 0;}void rename(char *s){printf("Character 1: %c\n",*s);*s='a';printf("Character 1 now: %c\n",*c);}Anyway, I am sure this is possible but for som...
- Reassigning references (to std::map in this case)...
Hi,Here's an example of something that feels like it should be OK butdoes in fact produce a segfault on every compiler I've tried (VC2005, g++ 4.1.2/Linux, g++ 3.4.4/Cygwin). The line marked // KABOOM is theone that segfaults. If I change the references to pointers (and makethe appropr...