Click here to Skip to main content
15,925,206 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHelp with Client Socket Reconnect Pin
NYTSX14-Mar-06 1:10
NYTSX14-Mar-06 1:10 
AnswerRe: Help with Client Socket Reconnect Pin
khan++14-Mar-06 1:39
khan++14-Mar-06 1:39 
AnswerRe: Help with Client Socket Reconnect Pin
Moak19-Apr-06 7:34
Moak19-Apr-06 7:34 
QuestionHow to add MouseMove message handling capability for a Static Picture Control Pin
velvel14-Mar-06 1:10
velvel14-Mar-06 1:10 
AnswerRe: How to add MouseMove message handling capability for a Static Picture Control Pin
Nibu babu thomas14-Mar-06 1:27
Nibu babu thomas14-Mar-06 1:27 
QuestionIs Gdiplus image will take any image as color image Pin
snprani@yahoo.com14-Mar-06 1:09
snprani@yahoo.com14-Mar-06 1:09 
Questionloading and destroying upon data verification: VC++.net Pin
luhfluh14-Mar-06 0:59
luhfluh14-Mar-06 0:59 
QuestionFind at lease 8 errors Pin
LiYS14-Mar-06 0:41
LiYS14-Mar-06 0:41 
My friend was going through an interview the other day, and he came up with a interview question: find at lease 8 problems out of the following code snippet.


#define max (1*1024*1024)
int main()
{
	char *f;
	char tmp[max];
	int i,j;//j should initialized to zero
	f = "In the second season, the show's writers introduce numerous new storylines for"; //initially was loadfile(f) and with comment saying interviewee shouldn't waste time on this line(error free). I changed it to just string of charaters
	for(i=0;i<=max;i++)//i < max
	{
		if(f[i]='\n')//intend to use comparison operator but
		{
			tmp[j++]=f[i];//tmp was undeclared
			tmp[j]=0; //null will mark the end of the file
			printf(tmp);//non existed function
			j=0; // erase the previous content
		}
		else
		{
			tmp[j++]=f[i];
		}
	}
	return 0;
}

when I trying to debug, I was confronted with "stack overflow" initially, I wonder what's wrong with 'f'
all the comments are my answers, but it doesn't anywhere near to 8 problems, so what do you think where the other problems lie and why.





-- modified at 9:16 Tuesday 14th March, 2006
AnswerRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 1:00
Gary R. Wheeler14-Mar-06 1:00 
GeneralRe: Find at lease 8 errors Pin
Rage14-Mar-06 2:03
professionalRage14-Mar-06 2:03 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:40
Gary R. Wheeler14-Mar-06 2:40 
AnswerRe: Find at lease 8 errors Pin
Rage14-Mar-06 1:59
professionalRage14-Mar-06 1:59 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:39
Gary R. Wheeler14-Mar-06 2:39 
AnswerRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 2:42
Gary R. Wheeler14-Mar-06 2:42 
GeneralRe: Find at lease 8 errors Pin
LiYS14-Mar-06 3:09
LiYS14-Mar-06 3:09 
GeneralRe: Find at lease 8 errors Pin
Gary R. Wheeler14-Mar-06 5:41
Gary R. Wheeler14-Mar-06 5:41 
AnswerRe: Find at lease 8 errors Pin
David Crow14-Mar-06 2:48
David Crow14-Mar-06 2:48 
GeneralRe: Find at lease 8 errors Pin
LiYS14-Mar-06 3:12
LiYS14-Mar-06 3:12 
AnswerRe: Find at lease 8 errors Pin
Prakash Nadar14-Mar-06 5:31
Prakash Nadar14-Mar-06 5:31 
QuestionError in adding values to List from File. Pin
Anu_Bala14-Mar-06 0:40
Anu_Bala14-Mar-06 0:40 
AnswerRe: Error in adding values to List from File. Pin
Gary R. Wheeler14-Mar-06 1:19
Gary R. Wheeler14-Mar-06 1:19 
AnswerRe: Error in adding values to List from File. Pin
David Crow14-Mar-06 2:55
David Crow14-Mar-06 2:55 
QuestionProgram crashing on Drop Pin
Anil_vvs14-Mar-06 0:33
Anil_vvs14-Mar-06 0:33 
AnswerRe: Program crashing on Drop Pin
Michael Dunn14-Mar-06 8:43
sitebuilderMichael Dunn14-Mar-06 8:43 
GeneralRe: Program crashing on Drop Pin
Anil_vvs15-Mar-06 18:18
Anil_vvs15-Mar-06 18:18 

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.