compiler construction - C calendar structure -
Can anyone quickly take a look at this code and see why I got a compiler error? It is a function to enter details in a calendar structure, and should create a node, i.e. an 'event' on the calendar.
struct event enter_key (zero) {int day, month, year, startTime, endtime, length; Four * slope; Structure event * n; Printf ("Enter the day: \ n"); Scanf ("% d", and day); Printf ("Enter Month: \ n"); Scanf ("% d", and; months); Printf ("Enter the year: \ n"); Scanf ("% d", and year); Printf ("Enter start time: \ n"); Scanf ("% d", and start time); Printf ("Enter End Time: \ n"); Scanf ("% d", and the end time); Printf ("Enter Details: \ n"); Scanf ("% s", & amp; descp); N = mcvant (day, month, year, start time, end time, & amp; descp); I found this message while trying to compile:
newpro.c: 115: Warning: passing the argument of 'mkevent' with incompatible index type
Can anyone tell me that I am declaring the indicator incorrectly, or if I should allot a place for the 'Despa' indicator, or I wrongly Have tried to create a node in the structure?
Thanks for reading, C Newb.
indicator should point to the user being entered in the scanf call Sufficient buffer for value
% s matches a sequence of non-whitespace characters; The next indicator should be an indicator for four, and the array must be sufficient to eliminate all the sequence and NUL characters. The input string stops at white space or at the maximum width of the field, whichever is earlier. Then it could be something like this
four characters [MAX_DESCRIPT]; Scanf ("% s", descp); However, in real-world code, you should use any one technique to read the wire as a result of buffer overflow (as well as possible user requirement to enter the details that have empty space). I have incorrectly tried to create a node in the structure?
I do not know the signature of the event, but I want the indicator to be a string buffer ( const char * ) rather than an indicator instead of an indicator on the string Expect to take the indicator (in descp instead of & amp; descp )
Comments
Post a Comment