You really need to learn to indent your code properly.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#define MAXSTRING 51
#define ALPHABET "ABCDEFGHIJKLMNOPQRSTUVWXYZ\0"
int x, i = 0;
char symbol = '$';
char UserInput[MAXSTRING];
/* Function prototypes are below */
char StoreSymbols( char EncryptionSymbols[27]);
char GetInput( char UserInputInput[MAXSTRING]);
void Output( char StringInput[MAXSTRING]);
/****************************************************************/
int main()
{
char EncryptionSymbols[27] = StoreSymbols(EncryptionSymbols[27]);
char StringInput[MAXSTRING] = GetInput(UserInput[MAXSTRING]);
Output(StringInput[MAXSTRING]);
/* Code above initializes variables and calls the functions in order */
}
char StoreSymbols( char EncryptionSymbols[27])
{
while (x < 26)
{
EncryptionSymbols[x] = symbol;
symbol += 2;
x++;
}
/* Code above loops until EncryptionSymbols is filled with symbols ready
for the actual encryption code. */
printf("%s", EncryptionSymbols);
if (EncryptionSymbols[26] != 0x00)
{
EncryptionSymbols[26]=0x00;
return(EncryptionSymbols[27]);
}
char GetInput( char UserInput[MAXSTRING])
{
char *InputPtr = UserInput;
printf("Enter in what you want encrypted(%i character limit ) \n", (int)MAXSTRING);
fgets(InputPtr, MAXSTRING, stdin);
if (UserInput[MAXSTRING-1] != 0x00) EncryptionSymbols[26]
{
UserInput[MAXSTRING-1]=0x00;
return (UserInput[MAXSTRING]);
}
}
void Output( char StringInput[MAXSTRING])
{
printf("You result is: %s \n", StringInput[MAXSTRING]);
printf("Press any key to exit \n");
getc( stdin );
exit(1);
return;
}
Code:
||=== testc2, Debug ===|
main.c||In function 'main':|
main.c|24|warning: passing argument 1 of 'StoreSymbols' makes pointer from integer without a cast [enabled by default]|
main.c|14|note: expected 'char *' but argument is of type 'char'|
main.c|24|error: invalid initializer|
main.c|25|warning: passing argument 1 of 'GetInput' makes pointer from integer without a cast [enabled by default]|
main.c|15|note: expected 'char *' but argument is of type 'char'|
main.c|25|error: invalid initializer|
main.c|26|warning: passing argument 1 of 'Output' makes pointer from integer without a cast [enabled by default]|
main.c|16|note: expected 'char *' but argument is of type 'char'|
main.c||In function 'GetInput':|
main.c|80|warning: statement with no effect [-Wunused-value]|
main.c|81|error: expected ';' before '{' token|
main.c|91|warning: no return statement in function returning non-void [-Wreturn-type]|
main.c||In function 'Output':|
main.c|98|warning: format '%s' expects argument of type 'char *', but argument 2 has type 'int' [-Wformat]|
main.c||In function 'StoreSymbols':|
main.c|109|error: expected declaration or statement at end of input|
main.c|109|warning: control reaches end of non-void function [-Wreturn-type]|
main.c||In function 'main':|
main.c|30|warning: control reaches end of non-void function [-Wreturn-type]|
||=== Build finished: 4 errors, 8 warnings (0 minutes, 11 seconds) ===|
StoreSymbols function is missing the closing "}" brace.
In C, you can not use a function to initialize a variable/array.
Code:
char EncryptionSymbols[27] = StoreSymbols(EncryptionSymbols[27]);