|
From: Per W. <pw...@ia...> - 2006-01-08 00:48:35
|
Just a note: you should always be careful with the use of directories
containing spaces, since unix tools always requires quotation marks around
the paths or the use of \ before the spaces in the path.
/Per W
On Sat, 7 Jan 2006, Sergio wrote:
> 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 =3D strlen(line);
> if(actuallen =3D=3D 0)
> return 0;
> for(i=3D0; 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 =3D 0, n;
> const int ll =3D 120;
> char line[ll];
>
> text[count] =3D '\0';
> n =3D gncline(line, ll);
> while(n !=3D 0) {
> if(n > 1) {
> count +=3D n;
> if(count >=3D NAMESIZE-2)
> {cout << "sry, message is too long,
> quitting..\n";exit(1);}
> strcat(text,line);
> text[count] =3D ' ';
> count++;
> text[count] =3D '\0';
> }
> n =3D gncline(line,ll);
> }
> }
>
> void encrypt(char m[])
> {
> int k =3D START, i;
> char ch;
>
> for(i=3D0; m[i] !=3D '\0'; i++) {
> ch =3D m[i];
> m[i] =3D substitutions[(ch - 32 + k) % len];
> k +=3D 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=F3n\Nuevas Pruebas\C11\encriptador
> i get this error:
> D:\Mis Documentos\Programaci=F3n\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.
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|