after the second input it seems like the fail flag is set and it wont accept input the next time
here is the code.. really small and simple program
Code:
#include <iostream>
#include <conio.h>
#include <cstring>
using namespace std;
int main (void)
{
int x = 0;
char *f1,*f2,*f3;
char f1f[20],f2f[100];
cout << "Enter the number of loops: ";
cin >> x;
cout << "Enter the Computer Name: ";
cin >> f1f;
cout << "Type in the message you wanna send: ";
cin.getline (f2f, sizeof (f2f),'\n');
f1 = new char [strlen(f1f)+1];
strcpy (f1, f1f);
f2 = new char [strlen(f2f)+1];
strcpy (f2, f2f);
f3 = new char [11+strlen(f1)+strlen(f2)];
strcpy (f3, "net send ");
strcat (f3, f1);
strcat (f3, " ");
strcat (f3, f2);
for (int i = 0; i < x; i++)
system (f3);
return 0;
}
cheers