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
Black_prince [1.1K]
3 years ago
15

Which C99 function can be used to convert a string to a double?

Computers and Technology
1 answer:
nordsb [41]3 years ago
5 0

Answer:

atof

Explanation:

atof function is used to convert a string to a double.

It takes a single parameter of type const char * and returns a double value.

The function signature is: double atof (const char* str);

In order to use this function in the code, you need to include the header file <stdlib.h>

For example:

#include <stdio.h>

#include <stdlib.h>  

int main()

{

   char str[5] = "0.01";

   double d = atof(str);

   printf("Value = %f\n", d);

   return 0;

}

You might be interested in
Drag the tiles to the correct boxes to complete the pairs. Match the conversion systems with their steps. To convert a decimal f
bixtya [17]

Answer:

1

Explanation:

8 0
3 years ago
Why was 1990 an important year regarding air quality?
fredd [130]

Explanation:

The United States created the Environmental Protection Agency. in some ways they have did that

4 0
3 years ago
Read 2 more answers
What type of desktop system is Sarah using in the following scenario? Sarah types the phrase “Open Document 3” onto a black scre
Vedmedyk [2.9K]

I'd go with command-line interface.

A CLI enables users to type commands in a console or a terminal window expressed as a sequence of characters and presses the enter key on the keyboard to execute that command. And in this case, Sarah is typing an “open document 3” command to the command-line interface to open a file in her computer.

4 0
3 years ago
Program 4 - Pick color Class Create a class that randomly pick a color from an array of colors: string colors[7]; Have the color
xxMikexx [17]

Answer:

#include<cstdlib>

#include<bits/stdc++.h>

#include<time.h>

using namespace std;

class Colors{

string colors[7];

public:

void setElement(int,string);

void printAllColors();

void printRandomColor();

};

void Colors::setElement(int index,string color){

colors[index] = color;

}

void Colors::printAllColors(){

cout << "Printing all the colors:\n";

for(int i=0;i<7;i++){

cout << colors[i] <<"\t";

}

}

void Colors::printRandomColor(){

srand (time(NULL));

int index = rand() % 7;

cout<< "\n\nThe random picked color:";

cout << colors[index] << endl;

}

int main(){

Colors color;

color.setElement(0,"red");

color.setElement(1,"orange");

color.setElement(2,"yellow");

color.setElement(3,"green");

color.setElement(4,"blue");

color.setElement(5,"indigo");

color.setElement(6,"violet");

color.printAllColors();

color.printRandomColor();

}

to get the random color we are using srand and rand function. we are using time as seed to srand() function,because every time the time is changed. And based on that we are using rand() function and doing mod with 7 with the random number to get the index between 0 to 6, as ut array size is 7(0 to 6).

In the setElement(int index,string color) method we are inserting the value of colors in the colors array based on index.

In the printAllColors() function we are printing all the colors in the array.

In the printRandomColor() er are printing any random color based on rand() function.

and in main() we are initializing the string array with colors and calling the functions.

7 0
3 years ago
Read 2 more answers
Which tcp/ip troubleshooting command should you use to determine whether a client and server are communicating with each other?
sesenic [268]
The answer is <span>The ping command.   The </span><span>tcp/ip troubleshooting command you should  use to determine whether a client and server are communicating with each other is The ping command.  </span><span>The </span>ping command<span> is used to verify that a device can communicate with another on a network.</span>
5 0
3 years ago
Other questions:
  • 1) which colour filter is used to pumps up black and white effects?
    13·1 answer
  • Write a function to add two large integers of any length, say up to 200 digits. A suggested approach is as follows: treat each n
    12·1 answer
  • This is used in a program to mark the beginning or ending of a statement, or separate items in a list:_____
    15·1 answer
  • What is an internal node?
    11·1 answer
  • What is the best use of a line chart? to show parts of a whole while emphasizing specific data to compare and contrast discrete
    9·2 answers
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • Inputting a range of numbers comprising a batch and then inputting each serially numbered document is characteristic of the cont
    11·1 answer
  • How do computer users benefit from the increased speed?
    9·1 answer
  • 1. A bank customer invested $24 in a bank with 5 percent simple interest per year, write a program the construct a table showing
    11·1 answer
  • Which website citation is correctly formatted according to MLA standards?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!