Artöm
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
Artöm
Artöm
... q(comp);
Artöm
Because comparison function cant be changed after priority_queue creation
Anonymous
It is still showing this.
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
Artöm
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?
01000001011011010100000101101110
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
Anonymous
01000001011011010100000101101110
Darío
Hello
Darío
Does someone know about a C++ boost telegram group?
I_Interface
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 ?
Anonymous
Sai Teja
I_Interface
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
Sai Teja
I_Interface
I_Interface
Sai Teja
and char also.
Size of union is the size of biggest data type in it
Sai Teja
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
☺
Anonymous
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
Anonymous
I_Interface
Anonymous
&someint
does fget only scan for one string variable or can you do more then one like scanf
I_Interface
Anonymous
Anonymous
thanks
i figured out what i was doing wrong now that i understand the difference between what fgets and scanf return
I_Interface
Anonymous
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.