Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:52
Mark Salsbery31-Aug-07 13:52 
QuestionRe: Trouble with const Pin
Mark Salsbery31-Aug-07 13:54
Mark Salsbery31-Aug-07 13:54 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 14:22
Leslie Sanford31-Aug-07 14:22 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:36
Mark Salsbery31-Aug-07 15:36 
GeneralRe: Trouble with const Pin
Leslie Sanford31-Aug-07 16:02
Leslie Sanford31-Aug-07 16:02 
GeneralRe: Trouble with const Pin
Mark Salsbery1-Sep-07 7:05
Mark Salsbery1-Sep-07 7:05 
AnswerRe: Trouble with const Pin
Leslie Sanford31-Aug-07 15:04
Leslie Sanford31-Aug-07 15:04 
GeneralRe: Trouble with const Pin
Mark Salsbery31-Aug-07 15:33
Mark Salsbery31-Aug-07 15:33 
The probem is not the const.

const unsigned char Sawtooth[] = {0,1,2,3,4,5,6,7,8,9};

If you try ...

Sawtooth[0] = 1;

...you'll see the compiler won't let you.

Passing Sawtooth as a const unsigned char * will work as well.

The assignment shown above won't work as you've seen - you need to deep-
copy the array contents from one to the other.  Note if the destination is const
you won't be able to unless you cast away the const.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionHow ot verify whether or not a user is a member of a local or domain group? Pin
Homayoun231-Aug-07 13:12
Homayoun231-Aug-07 13:12 
QuestionMFC Control Design Pattern Question Pin
@largeinsd31-Aug-07 10:56
@largeinsd31-Aug-07 10:56 
QuestionCStdioFile issue Pin
__yash__31-Aug-07 10:40
professional__yash__31-Aug-07 10:40 
AnswerRe: CStdioFile issue Pin
__yash__31-Aug-07 10:48
professional__yash__31-Aug-07 10:48 
QuestionCListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris31-Aug-07 8:27
Cris31-Aug-07 8:27 
AnswerRe: CListCtrl::SetBkImage(): how disable the image scroll? Pin
Cris3-Sep-07 3:13
Cris3-Sep-07 3:13 
QuestionCancel opening a file Pin
AeJai31-Aug-07 8:10
AeJai31-Aug-07 8:10 
AnswerRe: Cancel opening a file Pin
PJ Arends31-Aug-07 9:38
professionalPJ Arends31-Aug-07 9:38 
QuestionWM_TIMER Pin
__yash__31-Aug-07 7:28
professional__yash__31-Aug-07 7:28 
AnswerRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 8:01
Mark Salsbery31-Aug-07 8:01 
GeneralRe: WM_TIMER Pin
Waldermort31-Aug-07 9:33
Waldermort31-Aug-07 9:33 
GeneralRe: WM_TIMER Pin
Mark Salsbery31-Aug-07 9:42
Mark Salsbery31-Aug-07 9:42 
AnswerRe: WM_TIMER Pin
Waldermort31-Aug-07 9:34
Waldermort31-Aug-07 9:34 
GeneralRe: WM_TIMER Pin
__yash__31-Aug-07 9:40
professional__yash__31-Aug-07 9:40 
QuestionSetWindowPos & GetWindowRect Pin
Mr Simple31-Aug-07 7:05
Mr Simple31-Aug-07 7:05 
AnswerRe: SetWindowPos & GetWindowRect Pin
Mark Salsbery31-Aug-07 7:13
Mark Salsbery31-Aug-07 7:13 
AnswerRe: SetWindowPos & GetWindowRect Pin
Roger Broomfield31-Aug-07 17:32
Roger Broomfield31-Aug-07 17:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.