subject

String Basics. Write this assignment in C. YOU CAN'T USE ANY BUILT-IN STRING FUNCTIONS.

Write a function that takes strSource as a parameter. The function will return the length of the string.

Write a subroutine that takes strDestination and strSource as parameters. The subroutine will copy the source string to the destination string.

Write a function that takes strSource and chrLetterToFind as parameters. The function will return the index of the first occurrence of the letter (case sensitive) in the string searching from left to right. Return –1 if the letter is not in the string.

Write a function that takes strSource and chrLetterToFind as parameters. The function will return the index of the first occurrence of the letter (case INsensitive) in the string searching from left to right. Return –1 if the letter is not in the string. Do NOT change the source string.

Write a subroutine that takes strDestination and strSource as parameters. The subroutine will append the source string to the end of the destination string. Assume the destination string is large enough to hold all the characters.

Write a subroutine that takes strDestination and strSource as parameters. The subroutine will copy the source string to the destination string in reverse order. Do NOT change the source string.

Write a subroutine that takes strDestination and strSource as parameters. The subroutine will copy the source string to the destination string and make the destination string all uppercase. Do NOT change the source string.

Write a subroutine that takes strDestination, strSource, intStartIndex and intLength as parameters. The subroutine will copy a substring from the source string to the destination string starting at intStartIndex and of length intLength. Do NOT change the source string.

Write a function that takes strSource as a parameter. The function will return the number of words in the string. For example the sentence "Mary had a little lamb." has 5 words. Counting words is not the same thing as counting spaces. Do NOT change the source string.

Call each of the above functions from your main subroutine and display the results. For example:

void main( )

{

char strSource[ 50 ] = "I Love Star Trek";

int intLength = 0;

char strDestination[ 50 ] = "";

// Problem #1: String length

intLength = StringLength( "I Love Star Trek" );

printf( "Problem #1: String Length: %d\n", intLength );

printf( "\n" );

// Problem #2: CopyString

CopyString( strDestination, "I Love Star Trek" );

printf( "Problem #2: CopyString: %s\n", strDestination );

printf( "\n" );

etc

}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:00
Suppose s, t, and w are strings that have already been created inside main. write a statement or statements, to be added to main, that will determine if the lengths of the three strings are in order by length, smallest to largest. that is, your code should determine if s is strictly shorter than t, and if t is strictly shorter than w. if these conditions hold your code should print (the boolean value) true. if not, your code should print false. (strictly means: no ties) example: if s, t, and w are "cat", "hats", and "skies" your code should print true - their lengths are 3-4-5; but if s, t, and w are "cats" "shirt", and "trust", then print false - their lengths are 4-5-5 enter your code in the box below
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
You are most likely to automatically encode information about
Answers: 1
You know the right answer?
String Basics. Write this assignment in C. YOU CAN'T USE ANY BUILT-IN STRING FUNCTIONS.

Questions
question
Mathematics, 21.04.2020 18:24
question
Mathematics, 21.04.2020 18:24
Questions on the website: 13722367