Click here to Skip to main content
16,015,097 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to set a breakpoint in code Pin
JudyL_MD10-Sep-07 4:35
JudyL_MD10-Sep-07 4:35 
GeneralRe: How to set a breakpoint in code Pin
Soundman32.210-Sep-07 5:32
Soundman32.210-Sep-07 5:32 
GeneralRe: How to set a breakpoint in code Pin
jhwurmbach10-Sep-07 7:21
jhwurmbach10-Sep-07 7:21 
GeneralRe: How to set a breakpoint in code Pin
JudyL_MD10-Sep-07 10:33
JudyL_MD10-Sep-07 10:33 
QuestionRegistry function Pin
john563210-Sep-07 3:56
john563210-Sep-07 3:56 
AnswerRe: Registry function Pin
David Crow10-Sep-07 5:17
David Crow10-Sep-07 5:17 
GeneralRe: Registry function Pin
led mike10-Sep-07 5:20
led mike10-Sep-07 5:20 
Questiondata initialization, syntax of C++? Pin
includeh1010-Sep-07 2:53
includeh1010-Sep-07 2:53 
following code is correct.
class MyInt
{
public:
	int i0;
	int i1;
	int i2;
};
<br>
<br>
//there are hundreds of data, I only write down 3 of them 
MyInt myData[]=
{
	{1,	0,	2},
	{5,},
	{4,},
};


I hope default value of i1=100 and i2=200;
So I add construct to class MyInt:

class MyInt
{
public:
	MyInt()
	{
		i1=100;
		i2=200;
	}

	int i0;
	int i1;
	int i2;
};
<br>
<br>
MyInt myData[]=
{
	{1,	0,	2},//error line
	{5,},
	{4,},
};


This time, I got a compile error:
error C2440: 'initializing' : cannot convert from 'const int' to 'class MyInt'
which points to //error line.

The error looks like syntax error, how to solve the problem and set i1 and i2 to default values?
AnswerRe: data initialization, syntax of C++? Pin
Russell'10-Sep-07 3:44
Russell'10-Sep-07 3:44 
AnswerRe: data initialization, syntax of C++? Pin
Michael Dunn10-Sep-07 19:53
sitebuilderMichael Dunn10-Sep-07 19:53 
QuestionHow to decrease the CPU usage Pin
GauranG Shah10-Sep-07 2:47
GauranG Shah10-Sep-07 2:47 
AnswerRe: How to decrease the CPU usage Pin
baerten10-Sep-07 2:50
baerten10-Sep-07 2:50 
GeneralRe: How to decrease the CPU usage Pin
GauranG Shah10-Sep-07 3:18
GauranG Shah10-Sep-07 3:18 
GeneralRe: How to decrease the CPU usage Pin
David Crow10-Sep-07 5:22
David Crow10-Sep-07 5:22 
GeneralRe: How to decrease the CPU usage Pin
Mark Salsbery10-Sep-07 6:07
Mark Salsbery10-Sep-07 6:07 
QuestionJava Style Socket Programming in C++ Pin
maglev_tgv10-Sep-07 2:40
maglev_tgv10-Sep-07 2:40 
AnswerRe: Java Style Socket Programming in C++ Pin
baerten10-Sep-07 2:48
baerten10-Sep-07 2:48 
QuestionRe: Java Style Socket Programming in C++ Pin
maglev_tgv10-Sep-07 3:14
maglev_tgv10-Sep-07 3:14 
AnswerRe: Java Style Socket Programming in C++ Pin
baerten10-Sep-07 3:20
baerten10-Sep-07 3:20 
GeneralRe: Java Style Socket Programming in C++ Pin
maglev_tgv10-Sep-07 4:15
maglev_tgv10-Sep-07 4:15 
GeneralRe: Java Style Socket Programming in C++ Pin
baerten10-Sep-07 4:24
baerten10-Sep-07 4:24 
GeneralRe: Java Style Socket Programming in C++ Pin
maglev_tgv10-Sep-07 5:09
maglev_tgv10-Sep-07 5:09 
AnswerRe: Java Style Socket Programming in C++ [modified] Pin
maglev_tgv10-Sep-07 5:38
maglev_tgv10-Sep-07 5:38 
GeneralRe: Java Style Socket Programming in C++ Pin
baerten11-Sep-07 4:08
baerten11-Sep-07 4:08 
QuestionWriting a .html file Pin
neha.agarwal2710-Sep-07 2:22
neha.agarwal2710-Sep-07 2:22 

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.