ok...i have a question...if i would like to read the names of a family(for example for 4 people)..i set the structure and then in main i write...struct family array[4];...but how should i read the exact names...like this??
for(i=0;i<=3;i++){ gets(array.name[i]);/*or with scanf...??*/
why define a pointer only to assign it a string value of "good"? shouldnt a pointer just point to some vaule in memory....why didnt you just use a variable....dont understand why you used pointer here
@TheCosmicFrog yeah C++ has its own string library. It's still a C-style string though; but, you don't have to waste time writing the same general functions over and over again.
@nickrohn93 Never looked too deeply into C++ to be honest. Ran away from C as fast as I could and embraced Java. It's a sad realization that some day I will need to go back to C/C++ on my hands and knees and beg for its forgiveness.
@pagola hahah, what he did was fine. An array is a pointer. It points to a mem loc which can then hold data, which in this case is a 4 ASCII characters.
these videos are saving my life thanks a lot umicom. It is hard to find "advanced" C tutorials like this. Many of the more difficult concepts are mostly explained with C++ videos.
How can't you people see? Do you know how to enlarge the window?
TuggieGameReviews 11 months ago
There are lots of errors in these videos, on the pointer part as well as the structure part!!
I don't think this guy is a qualified teacher or experienced programmer
PoseidonHermes 1 year ago
Comment removed
PoseidonHermes 1 year ago
What will be the type of ptr_b?
int *ptr, ptr_b;
MrUsman4040 1 year ago
ok...i have a question...if i would like to read the names of a family(for example for 4 people)..i set the structure and then in main i write...struct family array[4];...but how should i read the exact names...like this??
for(i=0;i<=3;i++){ gets(array.name[i]);/*or with scanf...??*/
}...plz answer...
djcrank7 1 year ago
@djcrank7 try the predefined gets() function, you making a simple task more complicated than it needs to be.
Stung5 1 year ago
i cant see
sujeshanto 1 year ago
why define a pointer only to assign it a string value of "good"? shouldnt a pointer just point to some vaule in memory....why didnt you just use a variable....dont understand why you used pointer here
pagola 2 years ago
@pagola Because in C there is no variable that can hold a string. A string is instead held in an array of chars (or a "character array").
I believe C++ has a variable for holding strings though.
TheCosmicFrog 1 year ago
@TheCosmicFrog yeah C++ has its own string library. It's still a C-style string though; but, you don't have to waste time writing the same general functions over and over again.
Stung5 1 year ago
@TheCosmicFrog Well if you look at c++'s standard lib they use char type :P
nickrohn93 10 months ago
@nickrohn93 Never looked too deeply into C++ to be honest. Ran away from C as fast as I could and embraced Java. It's a sad realization that some day I will need to go back to C/C++ on my hands and knees and beg for its forgiveness.
TheCosmicFrog 10 months ago
@pagola hahah, what he did was fine. An array is a pointer. It points to a mem loc which can then hold data, which in this case is a 4 ASCII characters.
Stung5 1 year ago
can u zoom it in please???? i really need it! please....
ieL223 2 years ago
these videos are saving my life thanks a lot umicom. It is hard to find "advanced" C tutorials like this. Many of the more difficult concepts are mostly explained with C++ videos.
hommyhom 2 years ago
can't see
OTownDown54 3 years ago 10