Message from C, C++ discussions

December 2019

— Please create group for java

— 

Can someone help me on how to write a cpp function that combines addition,subtraction and multiplication

— 2*std:: getline and concatenate

— Yes

— What is the error in the (for)?

— Where do they get hardware for it, for turbo c and dos?

— Index out of bounds

— I < 10, not i <= 10
0 1 2 3 4 5 6 7 8 9 = 10 elements

— [C++20] Library: mutable constexpr expression for clang 9.0 and gcc 9.1

Hi there!

I've just published a weird c++ library targeting clang 9.0 and gcc 9.1.

It implements value/type changing constexpr expressions using new c++20 features.

Here's an example:

```c++
auto c = unconstexpr::meta_value{};
static_assert(++c == 1);
static_assert(++c == 2);
c << []{ return "hello"sv; };
static_assert(*c == "hello"sv);
static_assert(std::is_same_v<decltype(*c), std::string_view>);
```

If you're a godbolt fanatic like me you can test the above [here](https://godbolt.org/z/mUZwEy)
or use the project in godbolt directly by including:

```c++
#include <https://raw.githubusercontent.com/DaemonSnake/unconstexpr-cpp20/godbolt/godbolt.hpp>
```

If you like meta-programming, template, weird off-putting hacks, headaches it is just for you.
You can find it here [Github link](https://github.com/DaemonSnake/unconstexpr-cpp20)

Thanks for your attention!

https://redd.it/e99enu
r_cpp

Message permanent page

— Hello?

— Words with Length N


The program must accept a  space separated string S and an integer N as
the input. The program must print the words from S which are of length N
as the output. If no word is of length N then the program must print -1 as the output.


Boundary Condition(s):

1 <= Length of S <= 1000


Example Input/Output 1:

Input:

Have a good day

4


Output:

Have good


Example Input/Output 2:

Input:

help the need

2


Output:

-1

Message permanent page

— See this