Artöm
Try < and say if error is gone
Anonymous
no matching function for call to 'std::priority_queue<node, std::vector<node>, bool(node&, node&)>::priority_queue()' priority_queue<node, vector<node>, decltype(comp)> q;
Anonymous
Try < and say if error is gone
sadly it didn't go.
Artöm
... q(comp);
Artöm
Because comparison function cant be changed after priority_queue creation
Anonymous
It is still showing this.
Anonymous
Because comparison function cant be changed after priority_queue creation
I changed to priority_queue<node, vector<node>, decltype(comp)> q(comp);
Artöm
Strange. Try decltype(&comp) then
Artöm
I thought in this context function will also degrade to pointer
Artöm
Oh, decltype((comp)) (yep, double parentheses) might also work
Anonymous
Oh, decltype((comp)) (yep, double parentheses) might also work
Oh yeah both work. I hope the queue functions just as expected.
Anonymous
Anonymous
and work the same way?
Artöm
From type perspective yes
Artöm
Yes, same
Anonymous
#include <iostream> using namespace std; void display() { static int arr[2]; //some code to set all array elements to zero cout<<arr[0]; arr[0]=1; } int main() { display(); display(); return 0; } Output : 01 Needed : 00 So I'm trying to use a static array multiple times via function call, but I need every element to be zero for each call. Any way to achieve this without using a loop that sets the elements to zero one by one?
Anonymous
Memset?
Does it work for integer arrays too?
01000001011011010100000101101110
Anonymous
Yep.
K thanks, that was easy 😅
01000001011011010100000101101110
Anonymous
🔥😇
Do u know why it's defined in string.h tho? Looks like it should belong in stdlib.h or something
01000001011011010100000101101110
01000001011011010100000101101110
Darío
Hello
Darío
Does someone know about a C++ boost telegram group?
I_Interface
Does someone know about a C++ boost telegram group?
But u can ask ur question here, i think a lot of ppl used boost for C++.
Anonymous
main() { int a = 90 , b = 100 ; a++ ; a = (a ^ b) ^ (a = b ); b = a^b^a ; --a ; printf("%d %d",a++,b++) ; }
Anonymous
I want to know how it's working
Anonymous
What is struct in C , and what does it do ?
Anonymous
What is it's function ?
Sai Teja
What is struct in C , and what does it do ?
Structure is a user defined data type
I_Interface
I want to know how it's working
Read about bit operations.
Sai Teja
What is it's function ?
It is used to implement your own data type
Anonymous
struct s { int si; union u { float uf; char uc; }; }; main() { printf("%d",sizeof(struct s)); } What is its outpot and how ?
I_Interface
Suzeof( int + float)
and char also.
Sai Teja
and char also.
Size of union is the size of biggest data type in it
I_Interface
Size of union is the size of biggest data type in it
Ah, exactly. Still i don't understand for using union in 2019 with modern computers/phones.
Sai Teja
Ah, exactly. Still i don't understand for using union in 2019 with modern computers/phones.
As per my knowledge i remember that there is no change in union functionally from c++11
Anonymous
Hello
Anonymous
output: pruebaMontacargas.o montacargas.o g++ -std=c++0x -Wall pruebaMontacargas.o montacargas.o -o output pruebaMontacargas.o: pruebaMontacargas.cpp g++ -c pruebaMontacargas.cpp montacargas.o: /src/montacargas.cpp /include/montacargas.h g++ -c /src/montacargas.cpp clean: rm *.o output
Anonymous
I have this MAKEFILE, but it not Work and give me this ERROR msg:
Anonymous
g++ -c pruebaMontacargas.cpp make: *** No hay ninguna regla para construir el objetivo '/src/montacargas.cpp', necesario para 'montacargas.o'. Alto.
Anonymous
How can I fix it?
Anonymous
klimi
How can I fix it?
It says you what is wrong
Anonymous
Wanted a bit of explanation on the while loop in the program.
Anonymous
Since, there are 8 independent threads in execution, then why are we concerned with adding blockDim.x to tid.
Anonymous
Won't all the 8 threads work in parallel. if yes, then why to iterate ?
Anonymous
is it possible to scan for more then one variable with fgets
Anonymous
hey
Anonymous
kinda like scanf(“%i%s”, someint, somestring);
I_Interface
kinda like scanf(“%i%s”, someint, somestring);
Don't forget to take their addresses.
I_Interface
Anonymous
&someint
does fget only scan for one string variable or can you do more then one like scanf
I_Interface
Anonymous
thanks
i figured out what i was doing wrong now that i understand the difference between what fgets and scanf return
Anonymous
Good job.
do you use valgrind?
I_Interface
do you use valgrind?
Nope. I'm writing only with C++ on Windows with Visual Studio.
Anonymous
with xdg-open , is there a way to open more then one file at a time
Anonymous
in mac OS i can do open file1 file2
Anonymous
xdg-open seems to only work with one file at a time
Anonymous
Code for longest palindrome substring For eg. Input- ababaxx Output- ababa
Anonymous
In C or CPP
Anonymous
Asking this for assuring my understandin of the concept.