Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHook printer jobs Pin
Green Fuze15-Nov-08 9:05
Green Fuze15-Nov-08 9:05 
AnswerRe: Hook printer jobs Pin
Garth J Lancaster15-Nov-08 22:51
professionalGarth J Lancaster15-Nov-08 22:51 
QuestionCRichEditCtrl - problem with SetTargetDevice and TO_ADVANCEDTYPOGRAPHY Pin
szczepi15-Nov-08 8:57
szczepi15-Nov-08 8:57 
QuestionReferencing lib file Pin
Christian Flutcher15-Nov-08 7:25
Christian Flutcher15-Nov-08 7:25 
AnswerRe: Referencing lib file Pin
Mark Salsbery15-Nov-08 7:30
Mark Salsbery15-Nov-08 7:30 
GeneralRe: Referencing lib file Pin
Christian Flutcher16-Nov-08 6:56
Christian Flutcher16-Nov-08 6:56 
GeneralRe: Referencing lib file Pin
Mark Salsbery16-Nov-08 7:08
Mark Salsbery16-Nov-08 7:08 
GeneralRe: Referencing lib file Pin
Christian Flutcher16-Nov-08 7:12
Christian Flutcher16-Nov-08 7:12 
GeneralRe: Referencing lib file Pin
Mark Salsbery16-Nov-08 7:22
Mark Salsbery16-Nov-08 7:22 
GeneralRe: Referencing lib file Pin
Jijo.Raj16-Nov-08 7:34
Jijo.Raj16-Nov-08 7:34 
GeneralRe: Referencing lib file Pin
Christian Flutcher17-Nov-08 15:37
Christian Flutcher17-Nov-08 15:37 
QuestionProblems with malloc() and typedef struct Pin
Manfr3d15-Nov-08 3:11
Manfr3d15-Nov-08 3:11 
AnswerRe: Problems with malloc() and typedef struct Pin
Iain Clarke, Warrior Programmer15-Nov-08 3:18
Iain Clarke, Warrior Programmer15-Nov-08 3:18 
GeneralRe: Problems with malloc() and typedef struct Pin
Manfr3d15-Nov-08 4:08
Manfr3d15-Nov-08 4:08 
AnswerRe: Problems with malloc() and typedef struct Pin
cmk15-Nov-08 9:21
cmk15-Nov-08 9:21 
In C all variables must be defined at the start of the scope they belong to.

Change main() to:

int main(int argc, char* argv[])
{
  int width;
  int height;
  SMap* mySMap;
  
  printf("Enter width: ");
  scanf("%i", &width);
  printf("Enter height: ");
  scanf("%i", &height);
  
  mySMap = (SMap*)malloc(sizeof(SMap));
  
  return 0;
}


...cmk

The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack

GeneralRe: Problems with malloc() and typedef struct Pin
Manfr3d15-Nov-08 23:22
Manfr3d15-Nov-08 23:22 
GeneralRe: Problems with malloc() and typedef struct Pin
cmk16-Nov-08 8:47
cmk16-Nov-08 8:47 
Questionset focus to a control problem on win32 dialogs [modified] Pin
abdolahzadeh15-Nov-08 2:55
abdolahzadeh15-Nov-08 2:55 
AnswerRe: set focus to a control problem on win32 dialogs Pin
Code-o-mat15-Nov-08 3:36
Code-o-mat15-Nov-08 3:36 
GeneralRe: set focus to a control problem on win32 dialogs Pin
abdolahzadeh16-Nov-08 2:43
abdolahzadeh16-Nov-08 2:43 
AnswerRe: set focus to a control problem on win32 dialogs Pin
Mark Salsbery15-Nov-08 7:27
Mark Salsbery15-Nov-08 7:27 
GeneralRe: set focus to a control problem on win32 dialogs Pin
abdolahzadeh16-Nov-08 2:39
abdolahzadeh16-Nov-08 2:39 
QuestionRe: set focus to a control problem on win32 dialogs Pin
Mark Salsbery16-Nov-08 6:05
Mark Salsbery16-Nov-08 6:05 
AnswerRe: set focus to a control problem on win32 dialogs Pin
abdolahzadeh18-Nov-08 3:51
abdolahzadeh18-Nov-08 3:51 
GeneralRe: set focus to a control problem on win32 dialogs Pin
Phil Outram20-Sep-10 11:02
Phil Outram20-Sep-10 11:02 

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.