Mohit
I m beginner . Can anyone help me
Mohit
Anyone please??
Benjamine S.
Mohit
I m good bro
Mohit
Can you help me?? Talpa😇
Temur-Malik
so hello
Temur-Malik
admin u have channel c/c++
Temur-Malik
?
Temur-Malik
if u have can u throw the link
Dima
Lol
Temur-Malik
Speak in russ?
Dharan
Can anyone teach me dynamic programming?
Dharan
Can anyone teach me dynamic programming?
Or give some tutorial videos link🙂
Marián
can i somehow remove #define with g++ compilation flags?
Marián
this doesn't work for some reason
Anonymous
can i somehow remove #define with g++ compilation flags?
compilation flags cannot remove #define definitions because the preprocessor will run after the flags are processed
Marián
oh k thanks :D
Anonymous
In c++ using new keyword we use dynamic memory allocation, but in that case I used array with index size 3 and when I use above 3 index their is (array index out of bound I expect) but no error found
Anonymous
Refer above code
Ashish Bhushan
Remove it
Ashish Bhushan
Or you will get a warning from admin
I_Interface
/warn install telegram desktop and make a normal screenshot or use pastebin.com for your code.
Anonymous
Okay
Anonymous
This happens because you have enough memory available on your ram
Anonymous
Explain me in detail
Due to this when you try to access next index which is not declared it allows bcs the mory is free
Anonymous
As you know array stores element in a contigious way
Anonymous
It's drawback of c
Anonymous
Named as memory flow
Anonymous
Named as memory flow
don't invent terminology
Anonymous
Same code not excute in java
C doesn't check for array bounds. the job is delegated to the programmers. either you can use the array properly and make sure that there are no out of bounds accesses, or take a performance hit and use a library that implements a container with bounds checking.
Anonymous
it's all about trade-offs
Anonymous
https://github.com/stephenrkell/libcrunch The medium-term goal is ... performs usably well (hopefully no worse than half native speed, usually better).
Anonymous
Or just use C++
Anonymous
Or just use C++
well, they were already using Java
Anonymous
In c++ using new keyword we use dynamic memory allocation, but in that case I used array with index size 3 and when I use above 3 index their is (array index out of bound I expect) but no error found
i just noticed that you were already talking about C++. C++ already has libraries such as smart pointers that hide the new/delete calls, std::array and std::vector that implement arrays with optional bounds checking. std::vector<int> arr; // dynamic array with 0 elements at the moment arr[2] = 4; // undefined behaviour, use carefully. no performance loss arr.at(2) = 4; // throws exception for array out of bounds. performance hit PS - both of the above styles are kinda sorta bad. iterators are almost always the best way to access library containers, not indices.
Lieutenant
Can anyone guide me as to how I can write a program in C that cns apply a subnet mask on an IP address?
Lieutenant
That can*
Lieutenant
I know and understand how to use htonl and ntohl, and the inet_pton, inet_ntop functions to manipulate the string IP address and the binary form of IP address
Lieutenant
But I can't think of how to manipulate the bits of binary for of IP, so as to apply any subnet mask
Lieutenant
Basically, I can't figure out "what" to AND with the binary IP address
Asdew
Can anyone guide me as to how I can write a program in C that cns apply a subnet mask on an IP address?
Could you specify it a little and give some examples of input and output?
Lieutenant
Could you specify it a little and give some examples of input and output?
For example, if the input IP address (given as a char string) 192.168.1.154, and a given subnet mask of 24 (CIDR form), then the output string will store 192.168.1.0
Lieutenant
*actually ignore the word CIDR
Asdew
So, you would give it 192.168.1.154/24, and it would give you 192.168.1.0?
Lieutenant
So, you would give it 192.168.1.154/24, and it would give you 192.168.1.0?
Actually, the input would simply be the IP address 192.168.1.154, not the /24
Asdew
Is it always 24?
Lieutenant
Is it always 24?
Not. It's ranging from 16 to 30
Lieutenant
16 for the subnet mask of 255.255.0.0, up till 30, which is 255.255.255.0
Lieutenant
We'll be given "char mask" in the arguments
Lieutenant
Char means it would be character type.
Lieutenant
Is it always 24?
Shall I send the image of the problem statement for better clarity? (If allowed)
Asdew
Here's pseudocode to do the ANDing: ip_address & ((pow(2, mask) - 1) << (32 - mask))
Asdew
Where ip_address is a uint32_t with the IP address arranged in big endian (192.168.1.154 would, in hexadecimal, be 0xc0 0xa8 0x01 0x9a).
Lieutenant
Asdew
You just made this up right now? It did you use some resources?
I just made it up, it's just some simple math.
Asad
does stackoverflow occur if I call a function that calls another function and continues so on... ? it is not a recursion btw, just calling a function inside another one
Sasuke
Suggest a beginner project apart from game
Sasuke
does stackoverflow occur if I call a function that calls another function and continues so on... ? it is not a recursion btw, just calling a function inside another one
A function calling function is called recursion and stack will overflow if complier isn't optimising tail recursion.
Asad
ahh i forgot
Asad
i am doing GUI thing. There are multiple functions that contain Main Event Loops of different pages... For example, if the user presses CONTINUE, the program proceeds and another Main Event Loop function of different page will be called. The process continues until the user presses SAVE or something similar... Doesn't this lead to stackoverflow or it is better to change the architecture of the program?
Dima
Suggest a beginner project apart from game
network stuff, distributed systems
Dima
simplified distributed systems*
Asdew
A game server
Lieutenant
Anything else?
TCP/IP stack implementation?
Sasuke
TCP/IP stack implementation?
I think I have to go with this
Sasuke
Lieutenant
I think I have to go with this
Start with imitating the network as a graph. Then add networking properties like IP, MAC, subnet. Then implement a CLI to this. And keep going.
Lieutenant
May I suggest a Udemy course for this project?