I'm writing a C program to implement a shell that supports a few commands... one of them being "exit"
I made a table of commands that are supported and I wanted to use strcmp to match it to the...
Type: Posts; User: Newworld
I'm writing a C program to implement a shell that supports a few commands... one of them being "exit"
I made a table of commands that are supported and I wanted to use strcmp to match it to the...
I'm trying to write some student records to a binary file... Right when my program gets to part where it goes to write my structure to a file I get a segment fault during runtime.
here is the...
hmm, ok I've tried doing the printf debugging and it seems that I have some major problem when I'm trying to enter the name using
fgets(r[i].name,30,stdin);
when entering the info it does...
hmm.. I finally got it to compile, but it looks like I'm not correct in my coding for writing my structure to the binary file:
the program works fine as I go to the student function to enter info,...
ahhh yes, i completely forgot about needing a ; after ) when declaring a structure. Thank you.
It seems I have just two last errors:
project2.c: In function `print':
project2.c:114: warning:...
k, fixed the problems...
recompiled and still getting:
project2.c:17: two or more data types in declaration of `student'
project2.c: In function `delete':
project2.c:62: `rec' undeclared (first...
I'm writing a program to store information about students using structures. We store the information in a binary file. I am getting some compiler errors using the unix machines at school. I can't...
That is the entire code. I guess I will have to email my professor because everything I gave you is what is exactly what is given to me.
edit:
Assuming there is no typo and x,y,z are just useless...
I understand that, what I meant to ask was where are x, y, and z being used it this code?
I'm having trouble with this assignment which I'm supposed to show what the output would be for this code:
int x=1;
int y=2;
int z=3;
printf("%d %d\n", 3 | 6, 3 || 6);
printf("%d %d\n",...
ah, ok. Thank you.
and I was able to fix my other problems with declaring int i, before the for loop. I guess C doesn't allow you to declare int i in the for loop.
Lastly, I believe this will...
also as a side question... when i declare variables in C, is it ok to do it after main() ? Or am I supposed to be doing it all before main() ...
I am used to java where you can declare variables...
yea I changed the:
mar = if(leap==0)
{ (feb+28)%7;
} else {
(feb+29)%7;
}
to
ah, thank you ... unfortunately the compiler is still giving me the same error, which makes me wonder if it is because I am missing something farther up in the program.
So here is my entire program:...
ah, ok I didn't realize it was ; ...
I went through and changed them, but I am still getting the same error, only now it is showing the error only for
for (int i=1
I don't know why it is...
[QUOTE=Prelude]>for((days-i)>0,i++)
The grammar for a for loop is
for ( init(opt); condition(opt); increment(opt) )
statement;
hmm, I'm a little confused... I don't have any init(opt) for...
Parse error, expecting ''," or 'SEP'
on this line of code:
if((days-i)>=7)
{ printf("%d %d %d %d %d %d %d\n",i++,i++,i++,i++,i++,i++,i++);
} else {
for((days-i)>0,i++){...