If int num_students is in my strucutre, I'm confused at why that doesn't mean I have a variable...I thought by putting int num_students in my structure would mean I do have a variable num_students......
Type: Posts; User: computermajor12
If int num_students is in my strucutre, I'm confused at why that doesn't mean I have a variable...I thought by putting int num_students in my structure would mean I do have a variable num_students......
Thanks salem, I fixed that to
for(crp->num_students=0; num_students<100; ++num_students)
I'm still recieving this error when I try to compile it...:
project_test.c: In function...
Hello, I'm writing a program that allows an user to enter student information, and then will hold the information and will allow the user to "delete a student", "add a student", show class (which...
When I change my code to this:
void add_a_person(struct Classroom* crp){
for(crp.num_students=0;num_students<100;++num_students)
{
crp[num_students].fill_person=num_students+1;
struct...
I've been working on this code and I'm really trying to finish it ASAP. My project is to write a program that stores student input and creates a "classroom"... My main() should be a while loop that...
So i updated my code and added to my add_a_person function but it isn't compiling because it says I have not declared num_students but I delcare it in my structure?
Also, does my delete_a_person...
I'm doing the following project:
The classroom should be represented as a structure:
struct Classroom {
int num_students;
struct Person student[100];
};
The project requires the...
I've written a program for collecting data of students, it compiles and runs but I've called my show_person function and it is not showing it when I run it?
3 #include<stdio.h> 4 struct Person...
I got my code to compile, but now when I run it, It prompts me to enter the students name, and when I do that, and press enter I get
"segmentation fault"
and the program ends...
Thank you camel-man.
Now should my struct be in my main?
I was going to have my main be like this:
int main()
{
struct Person* per;
fill_person(&per);
show_person(&per);
Thank you Camel-man.
After fixing those issues I am still getting this error, I've looked into fgets and from what I understand it has to pass 3 arguments
assignment12.c: In function...
Usually I use C++ but was recently given an assignment in C...
here's the assignment:
Declare a structure named Person. The Person structure should have the following fields:
char name[100];...