Skip to content

Commit

Permalink
Added new question to c++ and fixed spacing and choices. (Ebazhanov#1465
Browse files Browse the repository at this point in the history
)

* adding a new question and fixed the spacing on Ebazhanov#59

* fixed the clickable button for choices
  • Loading branch information
swordwielder authored Apr 17, 2021
1 parent 4853a8d commit 3c1ba6e
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions c++/c++quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -1003,27 +1003,67 @@ center.x = 9;
center.y = 3;
```

- [ ] ```cpp
- [ ] A
```cpp
struct coord{
int x;
int y;
};
typedef struct coord coord;
```
- [ ] ```cpp
- [ ] B
```cpp
typedef struct coord{
int x;
int y;
} coord;
```
- [ ] ```cpp typedef struct coord{
- [ ] C
```cpp
typedef struct coord{
int x;
int y;
};
```
- [ ] ```cpp typedef struct{
- [ ] D
```cpp
typedef struct{
int x;
int y;
} coord;
```

#### Q60. You want to sort my_array, declared below. Which choice is the correct call to std::sort, using a lambda expression as the comparison function?

```cpp
std::array<uint32_t, 50> my_array;
```

- [ ] A
```cpp
std::sort(my_array.begin(), my_array.end(),
[](uint32_t a, uint32_t b) {
return a < b;
})
```
- [ ] B
```cpp
lambda(uint32_t a, uint32_t b){
return a < b;
}
std::sort(my_array.begin(), my_array.end(), lambda);
```
- [ ] C
```cpp
std::sort(my_array.begin(), my_array.end(),
lambda(uint32_t a, uint32_t b){
return a < b;
})
```
- [ ] D
```cpp
lambda(uint32_t a, uint32_t b){
return a < b;
}
std::sort(my_array.begin(), my_array.end(), &lambda);
```

0 comments on commit 3c1ba6e

Please sign in to comment.