|
From: Sergio <el...@gm...> - 2006-01-07 17:13:29
|
hi there:
im having a problem, when i compile this:
------------------------------------------------------------------------------
#include <iostream.h>
#include <stdlib.h>
#include <fstream.h>
#include <ctype.h>
#include <string.h>
#include "table.inc"
#define NAMESIZE 100
#define MSGSIZE 1000
ofstream outfile;
void OpenOutFile(void)
{
char filename[NAMESIZE];
cout << "Enter the name of the output file (will create if doesn\'t
exist):\n";
cin.getline(filename,NAMESIZE-1,'\n');
outfile.open(filename, ios::out);
if(!outfile.good())
{cout << "cannot open file, quitting...\n"; exit(1);}
}
int gncline(char line[], int len)
{
int i, actuallen;
cin.getline(line,len-1,'\n');
actuallen = strlen(line);
if(actuallen == 0)
return 0;
for(i=0; i< actuallen; i++)
if(!isprint(line[i]))
{cout << "invalid character, line discarded"; return -1;}
cout << "line len: " << strlen(line) << endl;
return actuallen;
}
void getmsg(char text[])
{
int count = 0, n;
const int ll = 120;
char line[ll];
text[count] = '\0';
n = gncline(line, ll);
while(n != 0) {
if(n > 1) {
count += n;
if(count >= NAMESIZE-2)
{cout << "sry, message is too long,
quitting..\n";exit(1);}
strcat(text,line);
text[count] = ' ';
count++;
text[count] = '\0';
}
n = gncline(line,ll);
}
}
void encrypt(char m[])
{
int k = START, i;
char ch;
for(i=0; m[i] != '\0'; i++) {
ch = m[i];
m[i] = substitutions[(ch - 32 + k) % len];
k += INCREMENT;
}
}
int main()
{
char msg[MSGSIZE];
OpenOutFile();
cout << "Enter text of message:\n";
getmsg(msg);
cout << "\nEncrypting and saving...\n";
encrypt(msg);
outfile << msg;
outfile.close();
system("pause");
return 0;
}
-------------------------------------------------------------
when i compile that on this folder:
D:\Mis Documentos\Programación\Nuevas Pruebas\C11\encriptador
i get this error:
D:\Mis Documentos\Programación\Nuevas
Pruebas\C11\encriptador\Makefile.win [Build Error] Error 1 enc.exe
but if i do the same on one folder at the desktop, i can compile it with
no problems....
is "C11\encriptador" cursed or what?
thank for reading.
SeR.
|