This is my attempt.
int scan_olympic(olympic_t *competition)
{
int result;
result = scanf("%c%c%c%d", competition->event, competition->entrant. competition->country, &competition->place);
...
Type: Posts; User: Hasnat Abul
This is my attempt.
int scan_olympic(olympic_t *competition)
{
int result;
result = scanf("%c%c%c%d", competition->event, competition->entrant. competition->country, &competition->place);
...
Write a C program that scans data to fill the variable competition declared below and then displays the contents of the structure with suitable labels.
#define STR_LENGTH 20
typedef struct
{...
As a general rule, why is it a good idea to avoid the excessive use of global variables. Please answer in detail, better if in points.
The objective is to use a linked list to remove vowels from a string.
This is the final code, but it does not work after compilation.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct charList /*struct list of char elements*/
Okay thanks. That fixed it.
How can I refrain from using strlen and free functions, I am trying to do it in C. IN other words, i am trying to replace them.
Also how do I separate functions and...
Thank you a lot. I fixed most of the errors. However, there are still few more left. I have mentioned the errors below.
#include <stdio.h>#include <stdlib.h>
#include <string.h>
struct CHlst...
#include <stdlib.h>
#include <string.h>
struct CHlst /*define element of list*/
{
char c;
CHlst* next;
}
void main()
{
char str[200]; /*string*/
It works with both valid and invalid dates now.
I did. It does not work i think, it still accepts dates like 35 .
Here is the code
void getDate(Car_t fleet[], int z, char dateType) /*Function that gets the date from the user*/{
int...
Is that correct?
So in the while part i would write?
while(day>0 && day <32, month>0 && month<13, year>1899 && year<2013)
void getDate(Car_t fleet[], int z, char dateType) /*Function that gets the date from the user*/
{
int day, month, year;
/*put a loop here to error check*/
if(dateType = 'm')
...
Thank you.
int main(void) /*Main function*/{
label(); /*Call display function which shows the function of program and name of programmer*/
Car_t fleet[FLEETSZ]; /*Declaring the fleet array */
...