xuozea
Read the rules
oh, thankyou.
𝔖𝔞𝔯𝔬
Design and implement your own kernel using C
Sounds like the most impossible task ever after learning css
Anonymous
hello, guys, could someone help me to debug simple server app? i wrote a simple app using epoll and thread and testing it with client. I set socket fd to EPOLLET (edge-triggered mode) and i'm always losing last 'package' from client till i run client next time. I can't understand why this is so. If i use standart EPOLLIN without flags everything is ok (obviously). i'm stuck 😢 log from client: ... I! Client: sending a number: [184] I! Client: sending a number: [185] sended: [185] time: [1.000000] log from server: ... I! Server: got data: [184] I! Server: No events! ... I! Server: No events!
Anonymous
with this little information I am afraid that no one will be able to help you :(
too much code to write in a message and links cannot be shared. so I described the essence of the problem and hoped that someone would agree to chat in direct
Null
@luigive117 send some plain text first, in the comments of your code sent here there were spam like patterns detected
artemetra 🇺🇦
hey, i have a combinatorics/algorithms related question. given some number n, i want to generate all sequences of length n, whose elements are integers from 0 to 7, such that: 1) the order of the elements DOES NOT matter (e.g. n=4; (0, 0, 6, 3) == (6, 0, 0, 3)) 2) the count of the elements DOES matter (e.g. (0, 0, 1, 1) != (0, 1, 1, 1)) i will be iterating over all of them and i know there will be many so i would like to have these things yielded as quickly as possible. what's the best to go about this? my initial idea was to have a map (or an array) of numbers from 0 to 7 with their respective counts in the final sequence and recursively generate all possible maps like this where the sum of counts equals to n, but i am wondering whether there's an easier way
artemetra 🇺🇦
now that i am thinking about it, the problem boils down to generating all arrays of length 8 whose sum is n 🤔
Siddharth
Hey, can someone please give an advice to how and where to learn C advance, I've learned the beginner part..
Priyobroto
Hi
Priyobroto
Good evening everyone
Priyobroto
I found a problem in terminal while running my program
Priyobroto
There is shown if($?
Priyobroto
How to solve this problem please help me
Olivia
Int a; Int *b=&a; If a memory address is 2000 Then what will be the memory address of b is it 2004?? Or what
klimi
How to solve this problem please help me
you will have to send the whole error and your code
Priyobroto
you will have to send the whole error and your code
But I am not allowed to send a screenshot
Priyobroto
klimi
May I send you personally?
with what reason? If it is just to send me a screenshot of code, you may not
Priyobroto
My cod is correct When I run the same code in intellige it returned the correct answer But in vscode the code doesn't even run It flashes if($?) {g++... Something like this I searched in stack overflow But did not find the solution
Chat Boss
Priyobroto Karmakar sent a code, it has been re-uploaded as a file
Ziky
Here is my code
Is possible to compile it? I would be quite surprised. int main(){ int n, arr[n],sum=0; cout<<"enter the size of the array"<<endl; cin>>n; you are declaring array of length n but in time of declaration n has random value. So you are ending with array of random length. I am ano sure if is even possible to have array of variable length on stack i would rather use dynamic allocation or just have array of fixed sufficient length.
LowKeY😎
please anyone to help me on functions? its really confusing me
Ziky
c++ functions
any example?
LowKeY😎
int max(int num1, int num2) { // local variable declaration int result; if (num1 > num2) result = num1; else result = num2; return result; }
LowKeY😎
how fucntion works. i dont really understand the whole concept
Wolfreddif
how fucntion works. i dont really understand the whole concept
block of code that executes only when it is called, makes your program organised, increases reusability of particular block of code.
LowKeY😎
oh okay. thanks.
LowKeY😎
so how will i go about it when trying to call the function please. was also confused about where to place them.
Wolfreddif
so how will i go about it when trying to call the function please. was also confused about where to place them.
you have to define the function before the code where it is called, and have to pass the required parameters when calling the function also have to make appropriate return type
LowKeY😎
oh okay. thank you so much
LowKeY😎
can you please give me a simple exmaple
LowKeY😎
example*
Wolfreddif
int max(int num1, int num2) { // local variable declaration int result; if (num1 > num2) result = num1; else result = num2; return result; }
like this example, declare this before main function... and then call it in main function giving two integers as parameters.
LowKeY😎
okay
Wolfreddif
you call it as cout<< max (1,2); in main... it will print 2
LowKeY😎
okay.
LowKeY😎
understood
Ruthless
Can i use string variable in switch case?
Xitino :(
nop
Lucas
Can i use string variable in switch case?
Switch statements only works with integral types, such as int, short, char (it is a integral type) and so on
Anonymous
Switch statements only works with integral types, such as int, short, char (it is a integral type) and so on
INBOX I SEND YOU A CODE HOW I USED SWITCH CASE TO MAKE A CLASS TIME TABLE
Dima
wtf
Anonymous
wtf
???
Anonymous
how to learn c++ as I have no prior knowledge of c
Anonymous
coding is depressing for me. as I don't understand it
klimi
how to learn c++ as I have no prior knowledge of c
watch some tutorials/read books/articles and practice a lot
User
Hello, I’m new here,can anyone help me for any algorithms for c++ material where to learn it
Papa
how to learn c++ as I have no prior knowledge of c
Learning C++ can be a great skill to have, and it's definitely possible to learn even if you have no prior knowledge of C or programming. Here are some steps to get you started: Start with the basics: Begin by learning the fundamentals of C++, such as variables, data types, operators, and control structures. You can find many online tutorials, books, or courses that cover these topics. Some popular resources for learning C++ include Codecademy, Udemy, Coursera, and Khan Academy. Practice coding: As you learn new concepts, practice writing code to reinforce your understanding. Try to solve small programming problems or work on simple projects to apply what you've learned. Learn object-oriented programming: C++ is an object-oriented language, which means that it emphasizes the use of classes and objects. Learn about the basics of object-oriented programming (OOP) and how to implement it in C++. This will help you to write more efficient and modular code. Use online resources: There are many online resources available for learning C++, such as online forums, blogs, and YouTube tutorials. These resources can help you to get answers to your questions, find inspiration, and learn new techniques. Practice with projects: Once you have a good understanding of the basics of C++, try to work on larger projects to further enhance your skills. You can start with small projects, such as creating a simple game or calculator, and gradually work your way up to more complex projects. Collaborate with others: Join online communities, such as forums or GitHub, to collaborate with other programmers and learn from their experiences. You can also attend coding meetups or participate in online coding challenges to get feedback on your code and improve your skills. Remember, learning C++ (or any programming language) takes time and practice. Be patient with yourself, and keep practicing to build your skills. Good luck!
Anonymous
Learning C++ can be a great skill to have, and it's definitely possible to learn even if you have no prior knowledge of C or programming. Here are some steps to get you started: Start with the basics: Begin by learning the fundamentals of C++, such as variables, data types, operators, and control structures. You can find many online tutorials, books, or courses that cover these topics. Some popular resources for learning C++ include Codecademy, Udemy, Coursera, and Khan Academy. Practice coding: As you learn new concepts, practice writing code to reinforce your understanding. Try to solve small programming problems or work on simple projects to apply what you've learned. Learn object-oriented programming: C++ is an object-oriented language, which means that it emphasizes the use of classes and objects. Learn about the basics of object-oriented programming (OOP) and how to implement it in C++. This will help you to write more efficient and modular code. Use online resources: There are many online resources available for learning C++, such as online forums, blogs, and YouTube tutorials. These resources can help you to get answers to your questions, find inspiration, and learn new techniques. Practice with projects: Once you have a good understanding of the basics of C++, try to work on larger projects to further enhance your skills. You can start with small projects, such as creating a simple game or calculator, and gradually work your way up to more complex projects. Collaborate with others: Join online communities, such as forums or GitHub, to collaborate with other programmers and learn from their experiences. You can also attend coding meetups or participate in online coding challenges to get feedback on your code and improve your skills. Remember, learning C++ (or any programming language) takes time and practice. Be patient with yourself, and keep practicing to build your skills. Good luck!
Thanks Papa,
User
Hello, I’m new here,can anyone help me for any algorithms for c++ material where to learn it
User
I have algorithms for c++ this semester at school
Alexandr
Hi! Is it possible to call each of variadic arguments with some function? template<typename T> void updatePreviousValues(EffectValues<T> effectValues...) { va_list args; va_start(args, effectValues); effectValues.updatePrevious(); va_end(args); } In this code just first param called I also tried: - effectValues.updatePrevious() but same effect - tried to put "..." in different places but always syntax error
Alexandr
Oh, seems like i miss va_arg(args, EffectValues<T>) 🧐
Alexandr
Still have no luck. Also tried (effectValues.updatePrevious(), ...); (chatGPT's advice)
Alexandr
Ok, i already found error that my function does not take lvalue. I did read about variadic templates and know how to do this. But question was about variadic arguments of just one same type of each argument
Danya🔥
Just use variadic templates, they are plain better
Alexandr
just to know if c++ can do this
Alexandr
ok
Alexandr
thx
Priyobroto
Okay thanks I will keep in mind next time
Actually I am new in c++ so When I will learn memory allocation I will edit this code then
Anonymous
Can anyone get me a code to draw a heart
Ziky
Can anyone get me a code to draw a heart
Sure: #include <stdio.h> void main() { printf(" ,d88b.d88b,\n 88888888888\n"); printf(" `Y8888888Y'\n `Y888Y'\n `Y'\n"); } Where can I send an invoice?
Ya deway
Hello guys why if i send a packet with pcap_sendpacket(interface_handle, packet, header.len) i got success code 0 but on wireshark i cant see the packet? (And on web server too)