I have been coding for a little bit in VB mostly and decided to try C right all is dandy until I try using a function
I am getting a conflicting types error in function encrypt
here is my beautiful code
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
/* Declaring the functions */
char encrpyt(int , char);
int key = 5;
char string[81];
gets(string);
encrypt(key , string);
system("PAUSE");
return 0;
}
char encrypt(int codekey, char stringydoo[80] ) /* Encrypt Header line */
{
int i,stringnums[80];
for(i=0; i<80; i++)
{
stringnums[i] = stringydoo[i];
if (stringnums[i]>=32 && stringnums[i]<=126)
{
stringnums[i] = stringnums[i]+ codekey;
if (stringnums[i]>=126)
{
stringnums[i] = 32 + (stringnums[i]%126);
}
stringydoo[i] = stringnums[i];
}
}
puts(stringydoo);
system("PAUSE");
}
this is the exact errors from bloodshed
21 xxxx\main.c conflicting types for 'encrypt'
13 xxxx\main.c previous implicit declaration of 'encrypt' was here