Professional Documents
Culture Documents
* File: main.c
* Author: Palak Kabra
*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define G 9.81
#define MAX_LENGTH 100
/*
* Programming Assignment 3
*/
int main(int argc, char** argv)
{
// IMPORTANT: Only add code in the section
// indicated below. The code I've provided
// makes your solution work with the
// automated grader on Coursera
char input[MAX_LENGTH];
fgets(input, MAX_LENGTH, stdin);
while (input[0] != 'q')
{
Input inputValues;
getInputValuesFromString(input, &inputValues);
return 0;
}
/*
* Extracts input values from provided string
*/
void getInputValuesFromString(char string[], Input *inputValues)
{
// find first space index
int spaceIndex = -1;
char *result = NULL;
result = strchr(string, ' ');
char *stringStart = &string[0];
spaceIndex = result - stringStart;
// free memory
free(thetaString);
thetaString = NULL;
}