𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Great, thanks, I'll look for ncurses then
hello
hi is it possible to use a file pointer name in a function in another c file where it is not declared?
Fl
Hello
klimi
There is, but this group is not for this :)
Ahmed
What??
Dima
banhammer incomin'
Fl
Easy*
ʙoᴍо͠ʏ
can anyone name an example of variable declaration
Kirk
ʙoᴍо͠ʏ
ʙoᴍо͠ʏ
I need 5 example
Kirk
You do the other 4, it's not hard, use other types too
ʙoᴍо͠ʏ
Kirk
Yes
ʙoᴍо͠ʏ
Or
#include <iostream>
using namespace std;
int main() {
int myNum = 15;
cout << myNum;
return 0;
}
ʙoᴍо͠ʏ
what about variable initialization
Iwan
if you need to learn faster, then you need to practice....more and more...you do it every hours everyday
#
Iwan
Brother how to learn fast any programming concept
when i learn something new like malbolge programming that i've learn, i take all of my time to practice and practice. i never stop until i can do it by my self. Theory can not help you if you are not do it. Practice can help you to be faster when you learn something new. Theory then practice, theory and practice.
dej
Hello guys, I need some help with converting a private chat based on tcp to udp
dej
I have some problems with multithread
Talula
dej
I can manage one single client
dej
But I have some issues with managing multiple clients
dej
can I share my github so that someone could see the issue?
Talula
Marlo
Any programing platform which is easier than visual studio??
dej
I can’t share my GitHub link
dej
Elil 50
Do I really need to initialize the array before the Macro?
https://imgur.com/a/DhwmEGV
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Hi, is there a way to spawn a new terminal command line on Linux from C?
I'm working on Ubuntu, but I would need this method to work for every linux distro. This new window should appear when a certain signal is handled, the user does stuff, then should disappear.
Can you direct me to some documentation or maybe a video, or anything, to both create and close the terminal window? Thanks!
klimi
You can just execute new terminal that is not a problem... closing the new terminal window might be harder depending on how you want to do it... Probably you could remember the forked PID and then sigterm it
Pavel
How can I invoke destructors for an array that I constructed in-memory using placement new?
void* data = allocateSomehow();
SomeType* myArr = new (data) SomeType[count];
...
myArr ->~ ??? // how can I destroy
freeSomehow(data);
Pavel
For the record, what I want it for, I want to allocate memory for two arrays of different types in one allocation (sizes not known at compile time).
B S
Hey
B S
How can I take user input input in pair in 2d vector in c++
B S
Please help me
klimi
klimi
and idk how it is on windows exactly with PIDs and stuff (I quite lack the knowledge of win interface)
klimi
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
mmm then I could try a setsockopt to give control back to the process after 4 minutes
klimi
delete myArr
(or maybe actually delete[] myArr... not sure)
klimi
Pavel
delete myArr
delete also deallocates the memory (also by specific rules, it's not said how I get the memory)
Marlo
Any programing platform which is easier than visual studio??
𐌂𐋅Ꝋ𐌍Ᏽ𐌄𐌍Ᏽ🫚
Fuk, sorry wrong typeing
𐌂𐋅Ꝋ𐌍Ᏽ𐌄𐌍Ᏽ🫚
Touch error
Dima
sure
klimi
Pavel
Pavel
Pavel
Anonymous
Why the order need to be reverse by the way, does it matter in which order they will be destroyed?
The usual standard way is for elements to be destructed in the reverse order of construction. It makes sense if you think that the element created last may depend on elements created before it. So destroying it first makes sense. All the STL containers follow that principle as well. It may not matter in your case but if you are designing a library, a user may use your library to create objects with dependencies. So destroying in the same order you created them may violate invariants of the User Defined Type and may lead to Undefined Behavior.
Pavel
Another question, is this a right way of having two arrays of different types in the same piece of memory?
https://wandbox.org/permlink/sUikkwSKXSmsEPYr
Pavel
I wonder if I introduced some UB or this looks fine
UPD: nevermind, found that I'm doing something stupid with the alignment
Anonymous
Anonymous
how can i print the result of a^b in (c) with out using a loop?
klimi
emiteclap
Elil 50
Do I really need to initialize the array before the Macro?
https://imgur.com/a/DhwmEGV
H
Why private member functions are declared in c++?
Azat
Why private member functions are declared in c++?
I believe to be able to "hide" from user to avoid undesirable use of those functions. Like indexing which allows you both read and change the data but you want only user to be able to read it. In that case, you can make it private and implement read_by_index(int idx) {return a[idx]}
Azat
Probably bad example. Probably someone can give a better one
Anonymous
Why private member functions are declared in c++?
Because they are mostly implementation details and are not required to be part of the interface of the class.
Because they can easily be changed without affecting the users of the class.
Because they offer some common functionality that can be shared by other public member functions and hence not required to maintain invariants of the class. They hence can't be directly called by users.
mito
Maybe something like a Movie class where you can use a public method searchMovie(std::string) to search for a movie by sending request to a rest API hosted somewhere.
First you will check what kind of response i.e status code you get for the request.
You can create that method int returnStatusCode (); in private because it will be only used within the searchMovie() method and you don't want it to be accessible on the outside.
Anurag
How to convert a string input to raw string in cpp?