Anonymous
since most of the people didn't read the book or they don't remember what task 2-6 are. Would you care to post what you are trying to do?
Sorry, the function setbits(x,p,n,y) Return x with the n bits that begin at position p to the rightmost n bits of y, leaving the other bits unchanged
Anonymous
Basically extracting the n bits from the position p in y
Anonymous
thant is not what you should do
Ahh I think I understand now, thanks
Sanchit
Hello Is there any way we can read a file present on a another server from c++ code run on another server
vyshnavi.
Hi all!
vyshnavi.
Can anyone suggest which YouTube channel is good to learn c++?
Jose
Can anyone suggest which YouTube channel is good to learn c++?
"learn C++" or "learn C with std::cout, with introduction to classes are on chapter 52"?
Jose
https://www.youtube.com/watch?v=YnWhqhNdYyk Related with the previous answer
Anonymous
Can anyone suggest which YouTube channel is good to learn c++?
This site segregates a lot of YouTube videos (around 750) on C++ into sections and topics. You can choose a topic and browse the video collection there. https://hackingcpp.com/cpp/educational_videos.html
Kosa
Assignment In this assignment, you will be implementing a Queue using the Stack data structure in C++. A Queue is an abstract data type that follows the First-In-First-Out (FIFO) principle, while Stack follows the Last-In First-Out (LIFO) principle. You will use two stacks to implement the Queue, where one will be used to enqueue elements, and the other will be used to dequeue elements. Instructions: 1. Use the Stack data structure (with push, pop, and top operations) that we implemented in the lecture. 2. Implement the Queue data structure using two stacks, Stack1 and Stack2. Stack1 will be used to enqueue elements, while Stack2 will be used to dequeue elements. 3. Implement the enqueue operation to add an element to the Queue. In this operation, you will push the element onto stack. 4. Implement the dequeue operation to remove the first element from the Queue. In this operation, you will pop the elements from Stack. 5. Implement the front operation to return the first element of the Queue without removing it. In this operation, you will return the top element of Stack. 6. Implement the empty operation to check whether the Queue is empty or not and the full operation to check whether the Queue is full or not. 7. Test your implementation with several test cases, including the case where the Queue is empty, and the case where the Queue is full Submit your implementation along with the test cases and a brief explanation of your implementation and the time complexity of each operation. Note: You are not allowed to use any built-in data structures or functions related to Queue or Stack, such as queue or stack, in your implementation
thelissimus
Assignment In this assignment, you will be implementing a Queue using the Stack data structure in C++. A Queue is an abstract data type that follows the First-In-First-Out (FIFO) principle, while Stack follows the Last-In First-Out (LIFO) principle. You will use two stacks to implement the Queue, where one will be used to enqueue elements, and the other will be used to dequeue elements. Instructions: 1. Use the Stack data structure (with push, pop, and top operations) that we implemented in the lecture. 2. Implement the Queue data structure using two stacks, Stack1 and Stack2. Stack1 will be used to enqueue elements, while Stack2 will be used to dequeue elements. 3. Implement the enqueue operation to add an element to the Queue. In this operation, you will push the element onto stack. 4. Implement the dequeue operation to remove the first element from the Queue. In this operation, you will pop the elements from Stack. 5. Implement the front operation to return the first element of the Queue without removing it. In this operation, you will return the top element of Stack. 6. Implement the empty operation to check whether the Queue is empty or not and the full operation to check whether the Queue is full or not. 7. Test your implementation with several test cases, including the case where the Queue is empty, and the case where the Queue is full Submit your implementation along with the test cases and a brief explanation of your implementation and the time complexity of each operation. Note: You are not allowed to use any built-in data structures or functions related to Queue or Stack, such as queue or stack, in your implementation
Alright, who's gonna do this guy's homework)))
mito
Assignment In this assignment, you will be implementing a Queue using the Stack data structure in C++. A Queue is an abstract data type that follows the First-In-First-Out (FIFO) principle, while Stack follows the Last-In First-Out (LIFO) principle. You will use two stacks to implement the Queue, where one will be used to enqueue elements, and the other will be used to dequeue elements. Instructions: 1. Use the Stack data structure (with push, pop, and top operations) that we implemented in the lecture. 2. Implement the Queue data structure using two stacks, Stack1 and Stack2. Stack1 will be used to enqueue elements, while Stack2 will be used to dequeue elements. 3. Implement the enqueue operation to add an element to the Queue. In this operation, you will push the element onto stack. 4. Implement the dequeue operation to remove the first element from the Queue. In this operation, you will pop the elements from Stack. 5. Implement the front operation to return the first element of the Queue without removing it. In this operation, you will return the top element of Stack. 6. Implement the empty operation to check whether the Queue is empty or not and the full operation to check whether the Queue is full or not. 7. Test your implementation with several test cases, including the case where the Queue is empty, and the case where the Queue is full Submit your implementation along with the test cases and a brief explanation of your implementation and the time complexity of each operation. Note: You are not allowed to use any built-in data structures or functions related to Queue or Stack, such as queue or stack, in your implementation
100$ give or take.
Kosa
100$ give or take.
Hahahahahahahahhahahaah
Chat Boss
Kosa sent a code, it has been re-uploaded as a file
Lodovico
Hi can anyone suggest me a course about system programming with c++ (Windows API Not GUI)
Anonymous
Hi can anyone suggest me a course about system programming with c++ (Windows API Not GUI)
Check out the resources section of this group. A book on this specific topic has been mentioned in the recommended list. FYI, the book name is Windows via C/C++
Juan
I'm trying to use crtp instead of pure virtual functions but am having trouble initializing the array. For example: ToolBase *tool_arr[3] = {&pen, &pencil, &brush}. If I want to use crtp to implement this, I still need to use virtual functions, so I feel like I'm back to square one. Here's the code https://pastebin.com/rxYU5XxU Update : I've been told that type list is one solution here 🤔 is it correct
Anonymous
I'm trying to use crtp instead of pure virtual functions but am having trouble initializing the array. For example: ToolBase *tool_arr[3] = {&pen, &pencil, &brush}. If I want to use crtp to implement this, I still need to use virtual functions, so I feel like I'm back to square one. Here's the code https://pastebin.com/rxYU5XxU Update : I've been told that type list is one solution here 🤔 is it correct
Your code uses CRTP , virtual functions et al but it seems like they are all forced into a big chunk of code in an effort to get them to work together. You should instead read up on TypeErasure and try using that instead. This encapsulates away CRTP and the requirement of deriving from a common base class away from your client code. For ex using Type Erasure, the classes Pen, Pencil et al don't have to derive from a common base or a CRTP base. You could do this behind the scenes in a TypeErasureHolder class. Using type Erasure also would help with duck typing meaning you don't need virtual functions. As long as the interface provides for a method with the necessary parameters, you can call it. If such a method is not present then it will be a compile time error.
Mahdiy
I'm working with node-addon-api. I cannot set value with reference to like this: Napi::ObjectWrap<Cronjob>::InstanceValue("time", &Cronjob::time) I just stuck there. Line 24: https://github.com/MahdiyDev/cron-jobs/blob/master/node/src/Cronjob.cc#L24
Null
@Codemonk avoid payment related context as a first message only in this chat
Anonymous
Hellow guys
Anonymous
Kindly i need help, anyone with documentary of c++ for the beginners guide help me out
Anonymous
Anonymous
Cppreference
I will appreciate your feedback, I am kindly waiting for the positive results 😊
Anonymous
?
Help me out with the beginner documentary guide for cpp learners please
Anonymous
Have you tried looking at cppreference?
No I haven't. But I am unaware of where to get the references from
Anonymous
Cppreference
I think he misunderstood "cppreference" as a question asking him whether he wants a reference for CPP.
klimi
No I haven't. But I am unaware of where to get the references from
Have a look at cppreference https://en.cppreference.com/w/
Kamal
Is there any benefit of using c++ over any other widely adopted middleware development language by security POV?
Manuel
The main benefit is in general performance, then there can be other project specific benefits: C++ developers available, compatibility, maintenance and integration in an existing C++ codebase etc.
@𝑺𝒐𝒃𝒌𝒂
Cppreference
Good recommendation. But the truth is that cppreference is not beginner friendly
Chat Boss
Løstrëgõ sent a code, it has been re-uploaded as a file
Anonymous
Løstrëgõ sent a code, it has been re-uploaded as a file
Change the inner loop to for(j=i+1;j<limit;j++) Also the value you enter for limit should be less than or equal to 5. A better solution would be to dynamically allocate memory that accomodates limit number of integers or even better use a vector instead.
Anonymous
Is there any benefit of using c++ over any other widely adopted middleware development language by security POV?
When you say widely adopted do you mean in general or in your organization? If it is the latter then it makes sense to stick to what is being used if you are not the one in a position to decide if a shift is required. If it is the former then you have to weigh the consequences. If something has been widely adopted, then it is so for a reason primarily support, issue addressing, available libraries and so on. Before moving to C++, you must see if all these issues are non issues and then consider moving. From a security point of view, coding in any language can expose security loopholes (C and C++ even more so). This is not a problem with the language per se but the programmer's problem. If this is not something you want to burden your programmers with, then a language like Rust may help but only to an extent. Even with Rust you can write an idiotic encryption algorithm that can be easily broken. So in a nutshell, security is a programmer's headache and languages/compilers can only help to an extent.
Anonymous
Good recommendation. But the truth is that cppreference is not beginner friendly
I think Klimi suggested cppreference because the user asked for C++ documentation and not a beginner friendly learning resource. Documentation of a language is usually terse and there is no escaping that. Anyway I also suggested books he/she can read to learn C++ if that is what he/she wanted and asked for documentation by mistake.
GOPA
is there any good free c++ ide in linux like visual studio
Anonymous
VsCode with plugins
+, As Dio was singing: that's the only way I found
Shuntaro Chishiya
what are the best sources to learn hooking ?
Anonymous
somebody created a website with c++ ?
Jose
is there any good free c++ ide in linux like visual studio
Geany, it's a good one, too. Another I used sometimes is Codelite, created to use with Cmake, you can take a look and evaluate it :)
Ludovic 'Archivist'
is there any good free c++ ide in linux like visual studio
If you are ready to pay, there is CLion, proprietary, but pretty good at what it does
𝔖𝔞𝔯𝔬
hi guys,
𝔖𝔞𝔯𝔬
//should work for both std::vector and std::array too... And other iterables objects template<class T> constexpr std::string stringfy(T arr , std::string(*ConversionFunc)(T::value_type) = &std::to_string) { std::string str = "{ "; for(auto& var: arr) { str += ConversionFunc(var) + " "; } str += " }"; return str; }
𝔖𝔞𝔯𝔬
i get compile error, and visual studio actualy tell me there is one, it basicallly doesn't allow me to use T::value_type inside the function declaration, how can i bypass this?
Danya🔥
typename T::value_type
𝔖𝔞𝔯𝔬
typename T::value_type
where should i put this
Pavel
where should i put this
Add typename before the type that is dependent on the template argument
Pavel
This basically says to the compiler "hey I know this type is not yet known during first step of the compilation, but I promise the actual type will have it"
𝔖𝔞𝔯𝔬
it worked
𝔖𝔞𝔯𝔬
Thank u a lot i did’t know this feature
Danya🔥
This is not a feature
Anonymous
This basically says to the compiler "hey I know this type is not yet known during first step of the compilation, but I promise the actual type will have it"
Actually this is not the case. The typename keyword says this is a typename and to treat it as such. By default the compiler assumes it is not a typename and T::value_type will be treated as a static member and not a typename. The typename is a hint to the compiler to treat it as a typename rather than a static member
Pavel
Especially because this kind of things worked (at least before) with MSVC where they didn't have this multi-step template compilation
Anonymous
Hm, interesting, I always thought it is to allow to use not yet introduced names
No. It is to help the compiler disambiguate between type names and static members. The default behavior of compilers is to treat scoped names of classes as static members
Anonymous
Sanchit
hello can anyone please give me the example program how i can just create a text file to another server by c++ program ?
GOPA
Is astrovim better than any IDE or IDE still better for large production
Guillermo
hello can anyone please give me the example program how i can just create a text file to another server by c++ program ?
You need to know about Network Programming (Sockets, Connections and all the stuff) to be able to create a text file into a server
Guillermo
TCP/IP Network Programming Design Patterns in C++ - vichargrave.github.io https://vichargrave.github.io/programming/tcp-ip-network-programming-design-patterns-in-cpp/
Guillermo
There you can look at documentation about that
Ziky
Is astrovim better than any IDE or IDE still better for large production
What is "better"? 😁 try it you will see if it is good for your needs
Skarn
Is astrovim better than any IDE or IDE still better for large production
I prefer vim plugin on top of other IDEs such as vscode or Clion, rather than hacking ide functionality on top of the vim itself.
Artem
Hello guys! I am a junior c++ programmer, studying software development in my university I want to join some serious open source projects. If you have some ideas what I can join, please do not hesitate to suggest them Or maybe you want a free worker, I would love to join your team. Thanks!
VEG
Or do the same with any other community supported open source project you use