C Programming Tutorial - 68: Array of Structure Variables

preview_player
Показать описание
In this tutorial we'll learn to work with arrays of structures. Hope you guys have fun watching it!
Рекомендации по теме
Комментарии
Автор

what about getting user input from command line argument and put that in array of struct? can you do one tutorial like that

kokoreply
Автор

wrong syntax of struct, in line number 9 there must be a semicolon after the curly braces, and how can a program run with error, ?

vaibhavkumawat
Автор

If you know c lan. then start video at 3:00

asifshekh
Автор

how do you use structs without angle brackets?

aaron___
Автор

I tried modifying this code so the user can select how many albums they want but I don't know what I am doing wrong. At the start of main, I declared an integer n, wrote printf/scanf statements to allow the user to choose how many albums, and then replaced the callout for two albums with n in the struct line as well as in both for loops.

But when I run I get a bunch of strange errors.

joe_limon
Автор

does anyone know how to return an array of struct from a function

ragyquiteque
Автор

#include<stdio.h>
struct node
{
char name[10];
int data;
};
int main()
{
char c[10];
int n=2, i;
struct node *st;
for(i=0;i<n;i++)
{
scanf("%s%d", st[i].name, st[i].data);
}
printf("%s", st[0].name);
}

this is my code and when i run it, it says the program has stopped. can't we use scanf? please help me

vaishnavi
Автор

And I don't think the printf on line 24 is only a decoration piece. It is much more than that.

alokjha
Автор

||warning: the `gets' function is dangerous and should not be used.|

miniwarrior
Автор

thx a lot
Jesus loves you
Believe in him and repent !

balaportejean
welcome to shbcf.ru