1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
3 years ago
6

With an example in each, describe the use of two basic functions which are known by the "string.h" header file.

Computers and Technology
1 answer:
olga nikolaevna [1]3 years ago
5 0

Answer:

strcmp(char * A, char * B);

strcat(char * A, char * B)

Explanation:

One of these basic functions is the function strcmp(char * A, char * B).

This functions compares if two strings are equal; If they are, it returns 0. If not, it returns 1;

So, an example:

char A[13] = "Buffalo Bills";

char B[13] = "Buffalo Bills";

if (strcmp(A,B) == 0)

printf("The strings are the same\n);

else

printf("The strings are not the same");

In this case, they are the same.

----------------------

If for example:

char B[13] = "Buffalo Billz"

It would fall in the else, A and B would not be the same strings.

--------------------------

Other function is the strcat(char * A, char * B);

This function takes two strings as an input, and concatenate them to the first.

For example:

char A[15] = "Buffalo";

char B[5] = "Bills";

strcat(A, B);

printf("%s\n", A);

The output is:

Buffalo Bills

You might be interested in
A game developer is purchasing a computing device to develop a game and recognizes the game engine software will require a devic
ale4655 [162]

Answer: Server

Explanation:

Options include:

A.Laptop

B.Server

C.Game console

D.Workstation

A server is referred to as a computer that helps in the provision of services, data or resources to other systems over a particular network.

Since the game developer wants a computing device to develop a game and recognizes the game engine software will require a device with high-end specifications that can be upgraded, the server is the best option for this.

5 0
2 years ago
The Circle and CircleTester have been created, but they have errors. The public and private settings for variables and methods a
professor190 [17]

<u>Answer:</u>

CIRCLE.JAVA

public class Circle {

  <em>private</em><em> </em>double radius;

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

<u>Explanation:</u>

public class Circle {

  //This could be made private or public.

  //Making it private is better

  <em>private</em><em> </em>double radius;

  //This is a constructor. It should be made public

  //since it would most likely be used in another class

  //to create an object of this class.

  //Making it private means no other external class can create

  //an object of this class.

  //Since the tester class (CIRCLETESTER.java), as shown on line 3,

  // needs to create

  //an object of this class, this should be made public

  <em>public</em> Circle(double myRadius) {

    radius = myRadius;

    private void setRadius(int myRadius){

    radius = myRadius;

 }

 //This should be made public since it will be

// used in another class (CIRCLETESTER.java in this case)

 <em>public </em>double getDiameter() {

    return radius*2;

 }

 public double getRadius() {

   return radius;

 }

 //This should be made public since it will be

 //used in another class (CIRCLETESTER.java)

 <em>public </em> double getPerimeter() {

   return Math.PI*getDiameter();

 }

 //The toString() method is the string representation

 //of an object and is called when there is an attempt to

 //print the object. It should be made public since it will

 //be used in another class (CIRCLETESTER.java)

 <em>public</em> String toString() {

    return "Circle with a radius of " + radius;

 }

}

CIRCLE TESTER.JAVA

public class CircleTester {

 public static void main(String[] args) {

    Circle circ = new Circle(10);

    circ.radius = 5;

    System.out.println(circ);

    System.out.println("The diameter is " + circ.getDiameter());

    System.out.println("The perimeter is " + circ.getPerimeter())

 }

}

8 0
2 years ago
Domain of (x+8)/(x(x+10))
UkoKoshka [18]
The domain of this, assuming it's a function, is all real numbers such that x does not equal zero or negative ten.

In interval notation, this is (-∞, -10) U (-10, 0) U (0, <span>∞).

In set builder notation, this is {x | x </span>≠ -10, x <span>≠ 0}.

These inputs are excluded from the domain because they would otherwise allow division by zero. Try plugging in one of the restricted inputs. You'll see that it does not work! On a graph of this </span>function, you will see vertical asymptotes. 

5 0
3 years ago
You can use this effect to break a color into a percentage of its full strength.
Dmitriy789 [7]
The answer on this scenario would then be c. drop out. This effect can be done if one wants to break a color into one's percentage of the full strength. Hope this is the answer and would be of big help.
6 0
3 years ago
To implement the various placement algorithms discussed for dynamic partitioning (see Section 7.2 ), a list of the free blocks o
STatiana [176]

Answer:

Check the explanation

Explanation:

Consider the following data

Let S represent the average number of segments

Let H represent the average number of holes

The probability that there is a hole immediately after the segment is 0,

So, when there are s segments in memory, there must be

s X 0.5 or \frac{s}{2}

Best-fit: this analyses the entire memory partitions available

a. you’ll have to selects the least one which is capable of handling the process exec.. Memo, space wastage .n be reduced In some cases, there will be no memory wastage

The average length a search is \frac{s}{2}

First-fit: This technique assigns Me the first hole that is big enough.

Searching Marts at the starting of Me set of holes.

The searching will be closed immediately a user gets a free hole that is big enough.

On an average it searches half of the set of holes.

The average length of search is Y2

\frac{s/2}{2} = \frac{s}{4}

5 0
3 years ago
Other questions:
  • A ____ can interpret physical addressing information.
    11·1 answer
  • What view is In a presentation program displays your slides in full screen mode
    6·1 answer
  • Which language is the most popular language for writing apple os x?
    9·1 answer
  • ____ is a utility that can verify that TCP/IP is installed, bound to the NIC, configured correctly, and communicating with the n
    11·1 answer
  • ERP packages are always quite simple.<br><br> True<br><br> False
    5·1 answer
  • Ile 1 cm<br> ?<br> 50 m<br> The an
    5·2 answers
  • What are Important points to include about preventing the download of malware?
    14·1 answer
  • Genetics Vocabulary: no <br> Allele: Different versions of the same qene (Aa, Bb)
    11·1 answer
  • It is a blueprint of a project​
    9·2 answers
  • Password ____ traverse the network searching for passwords from remote authentication systems.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!