Anonymous
Anonymous
we don't have a solution in that.. i tired
What do you mean by you don't have a solution? The examples listed clearly show how to parse an XML file with XMLReader, creating a tree from an XML file, navigating the tree, evaluating XPath expressions etc etc. What more do you want?
Anonymous
Hello here
Anonymous
I'm trying to install a program on windows 10 but keep getting "segmentation fault" error who can help me please?
Captain
klimi
Don't you think this is a spam?
Anonymous
Kriss
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Hey, can I send my hash map implementation in c to this chat for rating?
Anonymous
Kindly I'm new to C++ and I've finished learning data structure and algorithm and oop in C++ what topic should I cover next kindly?
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Manuel
L'amour, la mort... tout un programme haha
Manuel
Pavel
Thanks!
Here's your link deleted by the bot
https://yaso.su/5DDlVzfC
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Manuel
Looks pretty clean to me at first sight
Manuel
Links are forbidden here? Couldn't find it in the rules
Manuel
You haven't freed your calloc @mdntlzokfsmg ?
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Manuel
L94
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
I don't check NULL on calloc, but I freed memory with deleteHashMap
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
L75
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Yep, L33 cleans all memory
Manuel
/
What is crosscall2 for?
Anonymous
#include <iostream>
#include <string>
int main(){
std::string name,email,pwd,pwd2;
int age,birthday;
std::string profile[] = {name,email,pwd,pwd2};
std::cout<<"hello sir welcome to our program"<<std::endl;
std::cout<<"what is your name sir"<<std::endl;
std::cin<<name<<std::endl;
std::cout<<"what is your email sir"<<std::endl;
std::cin<<email<<std::endl;
std::cout<<"what is your password sir"<<std::endl;
std::cin<<pwd<<std::endl;
std::cout<<"what is your confirm your password sir"<<std::endl;
std::cin<<pwd2<<std::endl;
std::cout<<profile<<std::endl;
return 0;
}
Anonymous
why it doesn't work
Anonymous
i didn't understand the error
Anonymous
c++\test.cpp|12|error: no match for 'operator<<' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}')|
Anonymous
i did
Anonymous
Anonymous
1sec
Forest
Its cin>>variable;
Leteipa
#include<stdio.h>
void main()
{
int matrix1[10][10],i,j,m,n;
printf("enter the row and column of matrix1");
scanf("%d%d",&m,&n);
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&matrix1[i][j]);
}
}
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
printf("%d\t",matrix1[i][j]);
}
printf("\n");
}
}
Anonymous
Hey, can I send my hash map implementation in c to this chat for rating?
Your hashmap implementation idea seems ok.
The problems are
1) When two keys hash to the same value, you overwrite the previous value. Ideally, you should do something like a probe to determine the next free slot where it can be inserted. With your current implementation, I can use a non existent key that hashes to the same value that an existing key hashes to and retrieve that value. So during retrieval, you should compare the keys
2) A more serious problem is that when you overwrite a key, you don't check to see if the new key is greater in size than the old key and call strcpy blindly. This would result in Undefined Behavior. Use strncpy after allocating the correct memory.
Anonymous
`` 🇫🇷 ;; ce serai ta blonde ce soir, si c'est ce que tu aimes
Richard Luo 🐱
class B {
public:
int b = 10; B() { };
~B() { cout<<"b destruct"<<endl; }
};
class A {
public:
const B& b;
A(B&& b) : b(b) { }
~A() { cout<<"a destruct"<<endl; }
};
A* a;
void create() {
a = new A(B());
}
int main()
{
create();
cout<<a->b.b<< endl;
delete a;
return 0;
}
Richard Luo 🐱
The result is b destruct
10
a destruct
Richard Luo 🐱
I am confused... if b is destructed, why b is still accessible in the following line???
Aleksandr
file needs to be open twice in wt mode to be created and in rt mode to make copy of file. Why i can't copy file with wt mode?
Richard Luo 🐱
Null
Is there a c program to find the maximum and minimum points of a curve using calculus
Vez_Man
Please what's the difference between C, C# and C++
labyrinth
I encountered a case that I don't understand:
1. pushing 100k elements to a priority queue takes 79ms
2. popping 100k elements from the same priority queue takes 500ms
what is causing such performance difference ?
labyrinth
labyrinth
labyrinth
thanks a lot!
Anonymous
fair enough, your implementation differ from the theoretical performance difference as well
When I said implementation, I meant your compiler's standard library implementation. It is not always just a 2 factor. There could be additional costs like for ex: the comparator in your case or some internal mechanism in your library itself. The standard says that it is expected for pop to do 2 times more comparisons than push. So the 2 is already implicit. There could be additional costs depending on factors outside of your control. If you find this cost unsatisfactory, perhaps you should use a different data structure.
Anonymous
Gys I installed vs code but mingw-64 compiler is not download in chrome plzz send me link for mingw-64 compiler
mito
Strife
What do you think about carbon language?
Anonymous
#Puzzle
#include <deque>
#include <memory>
#include <vector>
struct A {
// (a) removing the following line - code compiles
std::deque<int> d;
// (b) removing the following line - code compiles
std::vector<std::unique_ptr<int>> v;
// (c) adding the following line - code compiles
//A(A&&) = default; // note: even without 'noexcept'
// (d) adding the following line - code compiles
// std::unique_ptr<int> p;
A() = default;
};
int main() {
std::vector<A> v;
// (e) removing the following line - code compiles
v.emplace_back();
}
The code above fails to compile. It would compile if you follow any one of the 5 instructions marked a,b,c,d and e.
Why?
Anonymous
/
static void _swig_gopanic(const char *p) {
struct {
const char *p;
} SWIGSTRUCTPACKED a;
a.p = p;
crosscall2(_cgo_panic, &a, (int) sizeof a);
}
/
/
And what is crosscall2
/
/
/
/
Daulet
Daulet
In your case you passes error message in arguments
/
/
Daulet