| | |
my program dont run good...array of structures in c...i used dev-c++
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Solved Threads: 0
c Syntax (Toggle Plain Text)
#include <stdio.h> #include <string.h> struct courses{ char coursenumber[10]; float credit; float grade; }; struct courses list[2]; main() { int i; int count; printf("Enter number of courses to input: "); scanf("%d", &count); for (i=0; i<2; i++) { printf("Course number: "); scanf("%s", list[i].coursenumber ); printf("Credit: "); scanf("%f", list[i].credit); printf("Grade: "); scanf("%f", list[i].grade); } printf("\n\n"); for (i=0; i<2; i++) { printf("%s", list[i].coursenumber); printf("%f", list[i].credit); printf("%f", list[i].grade); } return 0; }
Last edited by Ancient Dragon; Aug 7th, 2007 at 7:47 am. Reason: add code tags
•
•
Join Date: Aug 2007
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
What's your question?.
Post what is this program suppose to do. What kind of malfuntions it
has, what copiling errors you recieve, etc, etc,...
when i compile it... it compiles but when i run it in cmd... while entering the info it will stack and porst error messae like (dont send)....
•
•
•
•
when i compile it... it compiles but when i run it in cmd... while entering the info it will stack and porst error messae like (dont send)....
Example:
scanf("%f", &list[i].credit); needs it. Any thing that is not
printf("%s", list[i].coursenumber);
Last edited by Aia; Aug 6th, 2007 at 11:00 pm.
![]() |
Similar Threads
- Error with array structures :( (C++)
- Pascal : Cant see why program wont run, exits with error. (Pascal and Delphi)
- my program is compiled.but on run that i have message "Exception in thread "main" jav (Java)
- array of structures within a struct (C++)
- Dynamic Array of Structures, Loop problem! (C++)
- Creating dynamic array structures (C++)
- Passing array of structures into a function (C++)
- dynamic array of structures problem (C++)
- My computer is Closing itself. (Windows NT / 2000 / XP)
Other Threads in the C Forum
- Previous Thread: advice for this code
- Next Thread: .exe
| Thread Tools | Search this Thread |
#include adobe ansi api append array arrays asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc csyntax database directory dynamic execv feet fgets file fork framework frequency function getlasterror givemetehcodez global grade gtkgcurlcompiling hacking hardware highest histogram include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list lists locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue number odf opensource overwrite owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scripting segmentationfault sequential socket socketprograming standard string systemcall testing threads turboc unix user voidmain() wab windows.h windowsapi






