ok i got it with the shellexecute! thanks to everyone!!
though i still got some memory error at the end :S.
will anyone care to suggest something more?
Code:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
char* pass;
char* p="hello";
int i=0;
printf("Enter password and press ENTER.\n \n");
do
{
printf("Password: ");
scanf( "%s", pass);
if(strcmp ( pass, p ) == 0)
{
printf("Correct Password. \n \n");
i=10;
}
else
{
if(strcmp ( pass, "hint" ) == 0)
{
printf("Password Hint: Form of salutation. \n \n");
}
else
{
printf("Incorrect Password. \nType 'hint' for help. \n \n");
i++;
}
}
}
while (i<3);
if (i == 10)
{
printf("Opening program... \n\n");
//Open a program or file
ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL);
printf("Close program to contione. \nPress any key. \n\n");
getch();
}
printf("\n---- PROGRAM TERMINATED ----\n--- PRESS ANY KEY TO END ---\n");
getch();
return 0;
}