Question: C code. No errors in the code when you run it, but there are bugs in it. Please explain me what/where is wrong and how

C code. No errors in the code when you run it, but there are bugs in it.

Please explain me what/where is wrong and how to fix it to write the right code.

C code. No errors in the code when you run it, butthere are bugs in it. Please explain me what/where is wrong andhow to fix it to write the right code. stringhelp.h \#pragma once\#ifndef STRINGHELP_H \#define STRINGHELP_H \#define MAX_STRING_SIZE 511 \#define MAX_INDEX_SIZE 100 \#define MAX_WORD_SIZE23 struct StringIndex \{ char str[MAX_STRING_SIZE +1]; int wordStarts[MAX_INDEX_SIZE]; int lineStarts[MAX_INDEX_SIZE]; intnumberStarts[MAX_INDEX_SIZE]; int numWords, numLines, numNumbers; \} ; / * Return the indexof the next whitespace. * @param str - the string to search* areturns the index of the next white space or the positionof the string terminator. *) int nextWhite(const char* str); * @param word

stringhelp.h \#pragma once \#ifndef STRINGHELP_H \#define STRINGHELP_H \#define MAX_STRING_SIZE 511 \#define MAX_INDEX_SIZE 100 \#define MAX_WORD_SIZE 23 struct StringIndex \{ char str[MAX_STRING_SIZE +1]; int wordStarts[MAX_INDEX_SIZE]; int lineStarts[MAX_INDEX_SIZE]; int numberStarts[MAX_INDEX_SIZE]; int numWords, numLines, numNumbers; \} ; / * Return the index of the next whitespace. * @param str - the string to search * areturns the index of the next white space or the position of the string terminator. *) int nextWhite(const char* str); * @param word - where the result will be placed * aparam idx - the index to use * aparam wordNum - the index of the number to retrieve * areturns the number or an empty string if index is invalid */ void getNumber(char word[], const struct StringIndex* idx, int numberNum); /** * Return a pointer to the start of a line * aparam idx - the index to use * aparam lineNum - the index of the line to retrieve * areturns a pointer to the start of the line */ char* getLine(struct stringIndex* idx, int lineNum); /** * Prints characters until the terminator is found. * @param s - the string to print * aparam start the index to start printing * aparam terminator - the character to stop printing at when encountered. */ void printUntil(const char* s, const int start, const char terminator); /** * Prints characters until a space is found. * aparam s - the string to print * aparam start - the index to start printing */ void printUntilspace(const char* s, const int start); \#endif stringhelp.c \#define _CRT_SECURE_NO_WARNINGS \#include "stringhelp.h" \#include \#include \#include int nextWhite(const char* str) inti,result=1; for (i=0;result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!