Anonymous
What do you guys think about GTK for UI?
I've never used GTK so I can't say more I think it's also a good choice Qt is also because of Feature Integration in QtCreator IDE which makes UI development much easier It also allows styling with CSS which makes the UI more fluid.😎😎
Anonymous
itsmanjeet
Hey can we have any condition when map<string,SomeStruct> on clear or ~() gave segfault
SomeStruct{string,int,int}
I am getting SEGSEV on exit of program, and don't even know what's happening and how to debug that
Null
AlanCcE
AlanCcE
Hey guys, I'm planning to create a terminal-based messenger focused in privacy and anonymity using C. Can you share your thoughts if it's feasible to make this entirely in C?
I'm thinking of using XMPP protocol and TLS encryption for direct user connections.
Any similar projects or potential challenges I should be aware of?
布丁
布丁
It requires you to have a high level design of shared states, object lifecycle and concurrency etc.
布丁
Debugging can be annoying also when it comes to multithreading
AlanCcE
DaviChan
no problem :) Good Luck with the project! There are quite some implementations of xmpp clients. You should probably make a code review of some other clients before you start. This usually helps me to get design ideas. Think about what to copy/imitate and what you want to avoid.
For me I always try to minimize coupling of "modules" for example. They should be as independent as possible
Віктор
Hello, I have a question.
In this summer i want enter to internship in cdprojektred.
And i must write CV.
Can I write in cv, that i make 50+ problems on leetcode or it will be useless information?
DaviChan
for an internship i guess it can be mentioned ofc. ... I'm not involved with hiring people though at all.
Null
DaviChan
if not anything else this shows some dedication. For me personally github or something where i can see your work would be really nice. But also HR doesnt want to spend a whole lot of time on each resume, so make the most impressive things very easy to see
DaviChan
Null
DaviChan
ah okay ^^ Nice choice haha ❤️😂
DaviChan
I honestly don't know modern C, so its hard to compare, but in the past namespaces and classes where things i was missing in ANSI C to structure code better.
But honestly, I love C++, but the mere amount of features in the language makes it hard to enforce code guidelines on a larger project and makes it therefore again harder to maintain. Mhmm at the end i think it is 99% preference as long as its not asm. If you say asm or haskell, you might need to reconsider your language choice... anything else for regular console applications should be good 😅
Ziky
Костя
Hi! Please help me figure out how to implement this in code. I searched for information on StackOverflow, but I didn't find anything. The exercise for the lab is to create a CBigNumber, which is a large integer with a size of 128 bits (equivalent to two long long numbers)
Костя
😅😅😅
DaviChan
it is still an issue, because C++ is too flexible. Just think about how to initialize variables, when to use auto, when to return etc.
DaviChan
almost impossible to have everything in the style guide and actually have people follow it. 😅
DaviChan
clang tidy is really cool though. You can even have automatic fixes and you can be very specific to what you want. Really appreciated tool! (your code needs to compile with clang though)
Ziky
ynwqmv
rate pls💕
Anonymous
Hello everyone i need help
Write a function that receives three numbers as parameters and then returns their sum, product, and average using: 1-a pass-by-reference parameter 2-an array to return the required values
ynwqmv
c or c++
Anonymous
C++
ynwqmv
ok
Anonymous
ynwqmv
#include <iostream>
using namespace std;
void calculateStats(int a, int b, int c, int& sum, int& product, float& average) {
sum = a + b + c;
product = a * b * c;
average = static_cast<float>(sum) / 3.0;
}
int main() {
int num1, num2, num3, sum, product;
float average;
cout << "Enter three nmbers here..: ";
cin >> num1 >> num2 >> num3;
calculateStats(num1, num2, num3, sum, product, average);
cout << "Sum: " << sum << endl;
cout << "Product: " << product << endl;
cout << "Average: " << average << endl;
return 0;
}
Anonymous
https://pastebin.com/6vgfHq0q
Am I using headings correctly?
Anonymous
#include <iostream>
using namespace std;
void calculateStats(int a, int b, int c, int& sum, int& product, float& average) {
sum = a + b + c;
product = a * b * c;
average = static_cast<float>(sum) / 3.0;
}
int main() {
int num1, num2, num3, sum, product;
float average;
cout << "Enter three nmbers here..: ";
cin >> num1 >> num2 >> num3;
calculateStats(num1, num2, num3, sum, product, average);
cout << "Sum: " << sum << endl;
cout << "Product: " << product << endl;
cout << "Average: " << average << endl;
return 0;
}
Thanks I did the same thing but it asked me to use a function
ynwqmv
yes but it returns nothing
ynwqmv
we can only write return; (yeah, just return) to exit the function
Anonymous
ynwqmv
does anyone want to test it? ;D
DaviChan
DaviChan
from the description alone.
DaviChan
what do you mean by "SHA256 Encryption" ?
DaviChan
did you mean aes256?
DaviChan
i like that ur using asio for the networking though
DaviChan
will read through it later :)
Віктор
hello, i`am stupid monkey, and i can't understand, how i can correct this mistake
Віктор
Line 18: Char 19: error: no member named 'size' in 'ListNode'
b = head->size() / a;
~~~~ ^
Віктор
it`s a leetcode problem, and i can`t understand, why i can`t use "size".
Null
Anonymous
ynwqmv
No, bro. you don't understand me. here's a piece of code for you and I'll try to explain: std::vector<std::shared_ptr<tcp::socket>> sockets;
std::unordered_map<std::string, std::shared_ptr<tcp::socket>> data;. all connected sockets are stored in sockets, and data is stored in the socket and its hashed IP:port, and what do you mean, I'm working on it to make encryption for the entire network for secure communication))))))
ynwqmv
so data map container contains socket and hash for its host:port
ynwqmv
i made this for i think to provide some anonymously;D and to send private messages; /send recipient message
ynwqmv
that's it ...)
Anonymous
ynwqmv
madhu bro ... i dont encrypt whole network using SHA256. The program is simple chat-server. User can start the server and connect to it. Server can accept many connections so each nodes(users) can communicate and synchronise the chat . so when someone is connected to server, each users get its host and ports in the form of sha256 hash. By this hash users can send private message for the recipient only(only the recipient will see the message) ....
heaoven
SHA256 is digest algorithm,no encrypt algorithm, but RSA or AES is encrypt algorithm.
ynwqmv
i use the "encrypt" word to describe what happens with host n port of each users) im tired ;D
heaoven
Got it, you use hash to divide user?
ynwqmv
I'm experimenting with asio/ssl.hpp for encryption ....
ynwqmv
ynwqmv
i said i wrote it +- in 2 hours ))))) dont hate me
heaoven
ynwqmv
its like 248 lines of code u can see the source code in my githubrepo
Anonymous
-
Hi
I’m working on a DFS algorithm on a graph.
But I don’t know how to mark the wrong nodes which the program start to traverse from them an ends in a wrong answer.
Any idea how to solve it ?
ynwqmv
Prabakaran
Is there any reference for dos and don’ts on C/C++? Like what does the static analysis tools do to make sure all the potential threats are identified. Any book or reference will be helpful
Null
Null
https://github.com/cpp-best-practices/cppbestpractices
Olivia
int y=3^2^2*5/2+3;
cout<<y;
i got 9 answer why?
Ziky
Olivia
oh