lol.. I'm completely stumped. Clearly, there is something I'm not seeing here. Here is the entire source file:
Code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
int main()
{
FILE *ofp;
char asgNum[3], exercises[10][4] = {"\0"};
int numOfExercises;
/*
numOfExercises = 3;*/
exercises[0][0] = 'E';
exercises[0][1] = 'x';
exercises[0][2] = '0';
exercises[0][3] = '1';
/*int i;
for (i = 0; i <= numOfExercises; i++)
{
printf("\n%c%c%c%c", exercises[i][0],
exercises[i][1],
exercises[i][2],
exercises[i][3]);
}*/
system("clear");
printf("What assignment number are you doing? (Ex. P01)\n: ");
scanf("%s", &asgNum);
system("clear");
printf("How many exercises are there?\n: ");
scanf("%i", &numOfExercises);
system("clear");
int i;
for(i = 0; i < numOfExercises; i++)
{
if (i == 0)
printf("What is the 1st Exercise number? (Ex01)\n: ");
else if (i == 1)
printf("What is the 2nd Exercise number?\n: ");
else if (i == 2)
printf("What is the 3rd Exercise number?\n: ");
else
printf("What is the %ith Exercise number?\n: ", (i+1));
scanf("%s", exercises[i]);
system("clear");
}
//printf("\n%s\n", exercises[0]);
char phonyArray[10][4];
char phonyToo[4];
int z = 1, xx = 2, zzz = 3;
makeDirs(1,2,3);
return 0;
}//end main
// asgNum array of Excs. num of Excercises
//void makeDirs(char asg[4], char exc[10][4], int numExs)
void makeDirs(int f, int g, int blah)
{
int x, t;
for(x = 0; x < /*numExs*/g; x++)
{
//build sting
/*char path[10] = "\0";
strcat(path, "./");
strcat(path, asg);
strcat(path, "/");
strcat(path, exc[x]);
printf("\n\n%s\n\n", path);*/
/* t = mkdir(path,
//Permissions (Read, Write. Execute)
//for Others, User, and Group
S_IROTH | S_IWOTH | S_IXOTH |
S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IWGRP | S_IXGRP);*/
}
}
createMakeFile(int a, char fileName[], int asgNum, int exNum)
{
FILE *ofp = fopen(fileName, "w");
fprintf(ofp, "#Makefile for Kyle's CIS76 Class. #");
fprintf(ofp, "#Programing Assignment P%i - Exercise %i #\n",
asgNum, exNum);
/*fprintf(ofp, "###############################################");*/
}
/*
#Required source files:
# -Name.c
#If the Name executable file is missing or if Name.c has
#been changed, recompile
Name : Name.c
cc Name.c -o Name
#On clean, remove the executable file. (Usage: make clean)
clean:
rm Name
*/