Code:
#include <stdio.h>
//#include <dos.h> // Not needed
#include <stdlib.h> // Needed for system command
int main()
{
// A simple char is not enough to store a string... you need
// to use an array of characters
//char host, msg;
char host[20], msg[20]; // 20 is just an example
char command[60]; // This is for later
printf("\nEnter the hostname: ");
// You need to use the proper format specifier for the scanf function call
// %d is for reading in integers, %s is for reading in strings (arrays of
// characters). Also, in this instance you don't need the address-of operator (&)
// In front of the variable name
//scanf("%d", &host);
scanf("%s", host);
printf("\nEnter your message: ");
scanf("%s", msg);
// Now you need to use the sprintf function to format the string you wish to send
// to the system function.
sprintf(command,"net send %s %s", host, msg );
// The system function only accepts a single argument
//system("net send %d %d", &host, &msg);
system( command );
system("pause");
return 0;
}