I'm creating a password generator to 1) Make a utility that can help those who can't think of random, and safe, passwords to use to protect personal, even important, information; 2) To create a source to help those who wish to learn more of input/output of files; and 3) (most importantly) to learn more, to gain a little more knowledge that could, some day, help me succeed in larger, more complex projects.
Here's the source and the error messages I'm receiving:
Errors/Warnings:Code:#include<stdio.h> #include<stdlib.h> #define LEN 20 int main() { FILE *fp; int x; char random; char pass[21]; fp = fopen("pass.txt", "w"); if (fp == NULL) { fprintf(stderr, "Can't open output file!\n"); exit(1); } for(x=0; x<LEN; x++) { random = rand()%5+62; pass = strncat(random, pass, 21); } getchar(); return 0; }
[Warning] passing arg 1 of `strncat' makes pointer from integer without a cast
incompatible types in assignment
I'm using Bloodshed Dev-C++ (I've always used it).
Post any code corrections or ideas that may help.
Thank you!



LinkBack URL
About LinkBacks






