Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Example array of struct print
#include <stdio.h> #include <string.h> struct student { int id; char name[30]; float percentage; }; int printall(struct student record[]){ for(int i=0; i<3; i++) { printf(" Records of STUDENT : %d \n", i+1); printf(" Id is: %d \n", record[i].id); printf(" Name is: %s \n", record[i].name); printf(" Percentage is: %f\n\n",record[i].percentage); } return 0; } int main() { //int i; struct student record[2]; // 1st student's record record[0].id=1; strcpy(record[0].name, "Raju"); record[0].percentage = 86.5; // 2nd student's record record[1].id=2; strcpy(record[1].name, "Surendren"); record[1].percentage = 90.5; // 3rd student's record record[2].id=3; strcpy(record[2].name, "Thiyagu"); record[2].percentage = 81.5; printall(record); }
run
|
edit
|
history
|
help
0
20171116:FUNCIONES
Test2
Print Micro Seconds
Part 1: Draw Arts (square)
Función quicksort para strings
time clock and day count through second by user input (ratneshgujarathi)
B_141212_OrdenarArray
Undefined behavior
InterviewDesk_Embedded
150109_RecursividadParImpar