Computers and Technology

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

}

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 22:40, shaylawaldo11
Write a program that defines symbolic names for several string literals (chars between quotes). * use each symbolic name in a variable definition. * use of symbolic to compose the assembly code instruction set can perform vara = (vara - varb) + (varc - vard); ensure that variable is in unsigned integer data type. * you should also further enhance your symbolic logic block to to perform expression by introducing addition substitution rule. vara = (vara+varb) - (varc+vard). required: debug the disassembly code and note down the address and memory information.
Answers: 3
image
Computers and Technology, 23.06.2019 13:00, torresnoemi899
Which of the following statements is false? a. a class can directly inherit from class object. b. if the class you're inheriting from declares instance variables as private, the inherited class can access those instance variables directly. c. a class's instance variables are normally declared private to enforce good software engineering. d. it's often much more efficient to create a class by inheriting from a similar class than to create the class by writing every line of code the new class requires.
Answers: 3
image
Computers and Technology, 23.06.2019 16:00, keyonaemanieevans
Helen is having a meeting with her colleagues in her company. they are working on the goals and objectives for the coming year. they want to ensure that these goals and objectives of the processes involved are properly evaluated. which system can helen and her colleagues apply to evaluate this? helen and her colleagues require a blank to evaluate the goals and objectives.
Answers: 2
image
Computers and Technology, 24.06.2019 04:30, LouieHBK
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe and
Answers: 1
Do you know the correct answer?
String Basics. Write this assignment in C. YOU CAN'T USE ANY BUILT-IN STRING FUNCTIONS.

Questions in other subjects:

Konu
Mathematics, 14.04.2020 02:49
Konu
Mathematics, 14.04.2020 02:49