Click here to Skip to main content
15,896,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Trim function for char pointer [modified] Pin
nenfa30-Nov-09 20:18
nenfa30-Nov-09 20:18 
AnswerRe: Trim function for char pointer Pin
tolw30-Nov-09 20:25
tolw30-Nov-09 20:25 
AnswerRe: Trim function for char pointer Pin
KingsGambit30-Nov-09 20:31
KingsGambit30-Nov-09 20:31 
GeneralRe: Trim function for char pointer Pin
ggoutam730-Nov-09 20:43
ggoutam730-Nov-09 20:43 
AnswerRe: Trim function for char pointer Pin
Richard MacCutchan30-Nov-09 22:30
mveRichard MacCutchan30-Nov-09 22:30 
GeneralRe: Trim function for char pointer Pin
ggoutam76-Dec-09 23:15
ggoutam76-Dec-09 23:15 
GeneralRe: Trim function for char pointer Pin
Richard MacCutchan7-Dec-09 5:11
mveRichard MacCutchan7-Dec-09 5:11 
QuestionThreading in C. What is the use of HANDLE in the following code? Pin
Razanust30-Nov-09 16:53
Razanust30-Nov-09 16:53 
I couldn't understand the following things:
1) What's HANDLE and what function is it doing in this program?
2) When i run the prog, it gives an error message that "Expected initiliazer before int"? How to remove it? I have tried using int main(void) but no effect so far...



#include<stdio.h>
#include<conio.h>
#include<windows.h>
#include<process.h>

// Second Thread Funtion

void ThreadProc(void *param)
//First thread

int main(){
int n,i,val=0;
HANDLE handle;
printf("\t Thread Demo\n");
printf("Enter the number of threads: ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
val=i;
handle=(HANDLE)_beginthread(ThreadProc,0,&val); //create thread
WaitForSingleObject(handle,INFINITE);
}
return 0;
}

void ThreadProc(void *param)
{
int h=*((int*)param);
printf("%d Thread is running! \n",h);
_endthread();
}
QuestionRe: Threading in C. What is the use of HANDLE in the following code? Pin
«_Superman_»30-Nov-09 17:34
professional«_Superman_»30-Nov-09 17:34 
AnswerRe: Threading in C. What is the use of HANDLE in the following code? Pin
KingsGambit30-Nov-09 17:53
KingsGambit30-Nov-09 17:53 
Questionhow to make some area invisible Pin
lyp206030-Nov-09 15:26
lyp206030-Nov-09 15:26 
AnswerRe: how to make some area invisible Pin
«_Superman_»30-Nov-09 15:50
professional«_Superman_»30-Nov-09 15:50 
AnswerRe: how to make some area invisible Pin
loyal ginger30-Nov-09 15:51
loyal ginger30-Nov-09 15:51 
AnswerRe: how to make some area invisible Pin
Garth J Lancaster30-Nov-09 15:51
professionalGarth J Lancaster30-Nov-09 15:51 
GeneralRe: how to make some area invisible Pin
lyp206030-Nov-09 22:52
lyp206030-Nov-09 22:52 
AnswerRe: how to make some area invisible Pin
vasu_sri2-Dec-09 0:39
vasu_sri2-Dec-09 0:39 
GeneralRe: how to make some area invisible Pin
lyp20602-Dec-09 1:28
lyp20602-Dec-09 1:28 
QuestionSimple HTML Parser? Pin
justme8930-Nov-09 10:15
justme8930-Nov-09 10:15 
AnswerRe: Simple HTML Parser? Pin
Ravi Bhavnani30-Nov-09 10:53
professionalRavi Bhavnani30-Nov-09 10:53 
GeneralRe: Simple HTML Parser? [modified] Pin
justme8930-Nov-09 10:55
justme8930-Nov-09 10:55 
GeneralRe: Simple HTML Parser? Pin
Ravi Bhavnani30-Nov-09 11:13
professionalRavi Bhavnani30-Nov-09 11:13 
AnswerRe: Simple HTML Parser? Pin
Anurag Gandhi30-Nov-09 22:14
professionalAnurag Gandhi30-Nov-09 22:14 
Questionundo redo in console application with an operation Pin
002comp30-Nov-09 4:44
002comp30-Nov-09 4:44 
AnswerRe: undo redo in console application with an operation Pin
loyal ginger30-Nov-09 5:19
loyal ginger30-Nov-09 5:19 
AnswerRe: undo redo in console application with an operation Pin
Chris Losinger30-Nov-09 5:58
professionalChris Losinger30-Nov-09 5:58 

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.