struct Course{
char name[50];
char id[10];
char year[10];
};
struct A{
char name[50];
char id[10];
Type: Posts; User: sherwi
struct Course{
char name[50];
char id[10];
char year[10];
};
struct A{
char name[50];
char id[10];
what are the shortcomings?
Coz i'll be doing a search and sort program on a student database.I need to sort alphabetically or numerically based on the results returned the search function.btw, my...
u mean using strcmp like say strcmp(s1,s2)<0 and strcmp(s1,s2)>0 ?? will it work if i do this with insertion sort?
How can i sort strings using insertion sort?Is it possible?Coz i only understand this simply sort and im running out of time now...pls help..thanks
ya, i cant access that link too...
Ascending and descending based on the type of member i want to sort.For example,if i want to sort a string ,then it is in alphabetical order...Any idea how to do...
Hie there...
Does anyone here knows how to sort arrays of structures in ascending and descending order?In the simplest way?
For example my structure lookes like this:
struct Course{
...
Oppps, that's a silly mistake i made...Thanks alot guys and especially Salem!
Actually there are more stuff to search for in this program which i haven included.The rest will be likely to return...
ehmm...is anyone free to help me?I only have 2 days to my assignment due date... :(
hi all experts...
this is my assignment question, im required to create a search engine on a student database.I've created this but the program cant read the struct Record stud info .It's working...
for(j=0 ; j<6 && ch=='Y'; j++)
It this a valid statement?Coz it still runs the loop eventhough i type 'N'
else{
for(i=0 ; i<13 ; i++){
printf("Please enter student's name, id, year, major, credit hours, gpa and dean's list[yes/no]\n");
fgets(stud[i].name,30,stdin);
scanf("%ld %s %s %d %f...
else{
for(i=0 ; i<13 ; i++){
printf("Please enter student's name, id, year, major, credit hours, gpa and dean's list[yes/no]\n");
fgets(stud[i].name,30,stdin);
scanf("%ld %s %s %d %f...
else{
for(i=0 ; i<13 ; i++){
printf("Please enter student's name, id, year, major, credit hours, gpa and dean's list[yes/no]\n");
fgets(stud[i].name,30,stdin);
scanf("%ld",&stud[i].id);...
Is it okay if i change my program to use fgets() to get all strings?Instead of using clear_buffer function?
#include <stdio.h>
struct Login{
char name[15];
char password[15];
};
struct Course{
char name[50];
char id[10];
This means that i need to use this clear_buffer function each time i use fgets?I wonder why sometimes the compiler couldn't read fgets statement.It happens in a few of my programs!It just skip the...
thanks ssharish2005...
But may i ask why do we need void clear_buffer(void) function? :confused:
Thanks everyone for all the good replies and opinions!
I've decided to use binary files.But,i have a question here...
After opening a new file, when i am writing all my student data into that...
Hi all...
Im a little confused about the usage and purpose text and binary files.
To create a binary file, i need to fopen() a file with binary modes such as rb,wb,ab...etc... and we can only...
Can anyone help me ?plssss....thank you so much
Thanks spydoor..
#include <stdio.h>
struct A{
char name[50];
char id[8];
char year[8];
char grade[3];
#include <stdio.h>
struct A{
char name[50];
char id[8];
char year[8];
char grade[3];
};
struct Record{
Erm...i don't quite understand what u mean by this.Mind to explain?thanx
ok, i'll try then..thanx for the codes !
If it okay if i don't use scanf statements to get all the data?Instead i just initialize all the data in structure and write it to a file.Will it work the...
Hi vinit...thanks for da reply!
For my student database which consist :
Student name,ID,Year of degree,Major,Courses name and id,total credit hours,Grades for each course,GPA,Dean's list.
Is...