// Structure declaration and type definition
struct wordsRec {
int type;
// 0 represents non-number, 1 represents numbers.
char value[4];
};
typedef struct wordsRec Words;
int...
Type: Posts; User: ChwanRen
// Structure declaration and type definition
struct wordsRec {
int type;
// 0 represents non-number, 1 represents numbers.
char value[4];
};
typedef struct wordsRec Words;
int...
I find this weird: &(*circ).radius
Because isn't it saying the address of the value pointed to by the circ pointer? Shouldn't circ return the same thing?
int main(void)
{
struct circle circle[MAXCIRCLES]
getCircle(&circle[1]);
}
void getCircle(struct circle *circ)
{
printf("Centre: ");
scanf("%f, %f", &(*circ).centre.x,...
Why is it that the following code:
printf("? ");
scanf("%d", &n);
printf("? ");
gets(str);
skip the gets(str) step?
My guess is that the carriage return is not stored into n and still in...
Edit: yeah it works... thanks alot man. Going to look up what the %[ specifier does exactly now. Mind explaining how it works in detail?
thanks anyway.
I have a text file with the following lines:
1 | Matrix | 1 | Action | 3
2 | X-men 2 | 1 | Action | 2
.
.
.
id | movie name | rental type | genre | stock
I want to read the data from the...