Questions tagged [standard-library]

The standard library contains core utilities provided by all implementations of the language.

The standard library contains core utilities provided by all implementations of the language.

The size and scope of the standard library varies between languages, some provide only a few basic components for such things as string handling and I/O, whereas others provide higher-level tools for a wide variety of tasks such as XML processing, networking and database access.

For questions about specific languages' standard libraries use this tag in conjunction with the tag for the language, or use the indicated tags for these languages:

677 questions
0
votes
3 answers

Using putchar and printf together in the same C Program?

I've written a small C program where I wanted to display the numeric ASCII value that corresponds to certain key presses. My code follows. The problem is, after running the program, it accepts input, but doesn't do anything else. It doesn't even…
dvanaria
  • 6,593
  • 22
  • 62
  • 82
0
votes
2 answers

Why Python's standard library has a weak support for sending email

Python is advertised as a "batteries included" language. So, I wonder why it's standard library doesn't include high level support for emails: I found that you need to know lot about MIME to create an email message equivalent to what you can achieve…
Daniel Reis
  • 12,944
  • 6
  • 43
  • 71
0
votes
2 answers

Throwing n dice m times, what is the probability of getting atleast one six

I have the following code trying to solve the problem below: Thrown n dice m times, calculate the probability of getting at least one 6. I know that the exact probability of getting at least 1 six when throwing 2 dice is 11/36. My program below…
Palaios
  • 57
  • 1
  • 8
0
votes
2 answers

Finding occurrence of vector entries in another vector without nested for loops

I have a piece of code that I'm migrating from Fortran to C++, and I'd like to avoid some of the nested for loop structures I had to create in the original F77 code. The problem is this: I have a vector of objects called nodes that each include a…
Fadecomic
  • 1,220
  • 1
  • 10
  • 23
0
votes
1 answer

Not good stream at opening?

When I open a file in binary mode, does a situation exist where is_open() is true but good() is false ? bool ok = false; std::ifstream stream("test.dat", std::ios::binary) if (stream.is_open()) { ok = stream.good();//Does a situation exist where…
Vincent
  • 57,703
  • 61
  • 205
  • 388
0
votes
1 answer

Reorder, reindex array of objects by a property

I'm having an array arr of maps, for example arr == [ { pos => [0,0], color => :red, ... }, { pos => [0,1], color => :green, ...}, { pos => [1,0], color => :fuchsia, ...}, { pos => [1,1], color => :red, ...}, …
Adrian Panasiuk
  • 7,249
  • 5
  • 33
  • 54
0
votes
1 answer

InputMismatchException Error

I am receiving a compile time error saying: No exception of type InputMismatchException can be thrown; an exception type must be a subclass of Throwable InputMismatchException.java As far as I'm aware InputMismatchException is an exception thrown…
0
votes
3 answers

Is there a verify function in c standard libraries?

Is there a verify() function (Such as VERIFY() in msvc) or similar that is in the standard c libraries or do I have to write my own? If so, which header is it under? Edit: The difference between assert and verify is that verify will still execute…
ashleysmithgpu
  • 1,867
  • 20
  • 39
0
votes
1 answer

How do I view implementation source of printf?

I want to see how printf (and many other functions) works. I wrote #include #include int main() { printf(""); return 0; } in main.c code and go to definition in the right click menu but it shows something…
kim taeyun
  • 1,837
  • 2
  • 24
  • 49
0
votes
3 answers

Should you backup registers before calling a C Standrd Library function?

In assembly, should you backup registers before calling a C Standard Library function? Does the Standard Library guarantee that all of its functions backup the caller's registers and recover them in the end? Where can I find official…
Ori Popowski
  • 10,432
  • 15
  • 57
  • 79
0
votes
2 answers

Standard python function to split paths?

NOTE: Please, don't code it for me. I already have a home-rolled function to do what I describe below. Is there a function in the standard Python library that will take an absolute path as argument, and return a tuple of all its "atomic" path…
kjo
  • 33,683
  • 52
  • 148
  • 265
0
votes
1 answer

Standard C library support in custom language

I'm developing custom language, and everything works good, but I stopped at adding support of standard functions, like getchar(), fopen(), etc. One of my ideas is to parse visual .lib files, but it's massive task (e.g. because of lacks in…
chris
  • 664
  • 1
  • 12
  • 23
-1
votes
1 answer

Dynamically call CSS in a JSP

I have a JSP page which uses some kind of JSTL statment to refer a CSS... Now this same abc.css is located in 3 separate folders and based on some condition it picks dynamically from one of these 3 folders.. I am not sure…
copenndthagen
  • 49,230
  • 102
  • 290
  • 442
-1
votes
1 answer

Get iterable of 2-tuples from even iterable

Is there a function in the standard library, that can generate an iterable of 2-tuples of an iterable that is guaranteed to have an even amount of elements? INPUT = 'ABCDEF' OUTPUT = [('A', 'B'), ('C', 'D'), ('E', 'F')] I could not find anything…
Richard Neumann
  • 2,986
  • 2
  • 25
  • 50
-1
votes
1 answer

How to include «pty.h» Header File on Unix / Add «pty.h» to Standard library C / C++

I would like to include pty.h which is not normally available on Unix (Not included in standard library). On the Internet, you can get the related header file content. So how do you add this header file to the standard library, so that it's possible…
Tthrow
  • 55
  • 4