Holup
Saint Paul
Iwan
Iwan
biner. binary
Iwan
I think it is time for me to leave this group.
I dont like this stupid timer.
Bye² all.
Jillur Rahman
How can I use logarithms when I have to find the product of 4 variables (each variable is having a maximum possible range of 1e9)?
Chat Boss
𝕂𝕦𝕤𝕙𝕒𝕘𝕣𝕒 🏳️🌈 sent a huge message, it has been re-uploaded as a file
i recently started learning c, and was working on a program to swap variable values.
i created t..
klimi
^ you are just swapping pointers, not the values, so the program just does what you have told it
Abdul
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int a;
print("Enter a number");
scanf("%d",&a);
printf("you have entered %d",a);
return EXIT_SUCCESS;
}
Abdul
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int a;
print("Enter a number");
scanf("%d",&a);
printf("you have entered %d",a);
return EXIT_SUCCESS;
}
plz tell me , how to solw it
klimi
April
April
the first "print"
Anonymous
April
The parameters of the main function are entered from the command line terminal
Mitesh
Hi all,
https://github.com/mitesh-gohel/queries/blob/main/t2.c
Can anyone help me to understand behaviour of this code ?
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
guys read and write, when used for TCP socket communication, return -1 on error, right?
For istance, server-side is stuck on a read, client-side the client closes the socket (close(client_socket) and exits (exit(0)).
Well, the read server-side should return -1, right? Well, it returns 0 to me... and I'm not quite sure why this happens. Do you have any ideas?
The code is for POSIX systems, but I'm coding on windows, I use WSL for terminal and gcc to compile.
Kay
Can everyone explain what the system ("pause") function is?
Anonymous
guys read and write, when used for TCP socket communication, return -1 on error, right?
For istance, server-side is stuck on a read, client-side the client closes the socket (close(client_socket) and exits (exit(0)).
Well, the read server-side should return -1, right? Well, it returns 0 to me... and I'm not quite sure why this happens. Do you have any ideas?
The code is for POSIX systems, but I'm coding on windows, I use WSL for terminal and gcc to compile.
Can't you check the documentation?
A read() call on a socket is equivalent to a recv() call without any flags.
Here is a quote from the documentation for recv() for your use case.
When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return).
In future, learn to read the documentation.
Anonymous
Mitesh
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
Can't you check the documentation?
A read() call on a socket is equivalent to a recv() call without any flags.
Here is a quote from the documentation for recv() for your use case.
When a stream socket peer has performed an orderly shutdown, the return value will be 0 (the traditional "end-of-file" return).
In future, learn to read the documentation.
That's right, my professor anyway says that it must return -1 when client collapses. Which is very strange, since when the client abandons in an unpredictable way it must return -1 as it is an error, but if all writing process correctly close the connection on the client side, then it returns 0. But my professor insists it returns -1 anyway, that's the reason of my question.
When I hit the client with CTRL+C the client will close socket, and on the other side the server, stuck in the read, will return
Errno= 0
Streerror(errno)= SUCCESS
and i really don't know if it is correct, but I take it as SUCCESS means that on the other side the channel was properly handled
𝕷𝖔𝖗𝖊𝖓𝖟𝖔
At this point I think we had a misunderstanding, as the documentation is very clear and even in his papers, when talking about PIPEs, he says that a read call returns 0 when all writers processes correctly close the pipe on the other side
Llll
Hello guys, I am experiencing problems trying to make intellisense and MSVC compiler recognise includePaths for my ns3 simulation c++ code. Running the compilers throws errors that the header files cannot be found, and intellisense shows red squiggly lines under the specified headers.
Llll
I have specified the headers in the c/c++ compiler configuration in the .vscode folder but nothing seem to work.
Ziky
There might be something like include paths but I am not Ms fan
Llll
Yes, I specified it but intellisense happens to ignore it
Chat Boss
Dαɾƙ Tαɳɠҽɳƚ sent a code, it has been re-uploaded as a file
Anonymous
Dαɾƙ Tαɳɠҽɳƚ:
Sample Input 2:
2
9
1 3 6 2 5 4 3 2 4
12
6
2 8 10 5 -2 5
10
Sample Output 2:
0
2
when i do second testcase then it is showing 3 as output instead of 2
Ziky
If you can see compiler commands somewhere check if it is set there https://learn.microsoft.com/en-us/cpp/build/reference/i-additional-include-directories?view=msvc-170
Llll
I have ns3 installed built on wsl on windows and I am interfacing it using vscode from windows through a mapped UNC address to the wsl virtual drive
Anonymous
Pls someone help
Anonymous
Ziky
I think you are breaking the rules
Ziky
Don know wat it is supposed to do
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
if(sum==arr[i]+arr[j]){
pair++;
}
}
}
but try to put arr[i]+arr[j] into parenthesis
Anonymous
Anonymous
It is not wrong because there are two test case first is right but in second when it is printing 3 but the right answer is 2
Ziky
Ziky
hmm ok addition seems to have priority over comparison
Ziky
at least at onlinegdb :D
Anonymous
Ziky
Ziky
I guess you might want to exclude cases when i==j
Ziky
But i have no idea what is your code supose to do
Jose
Mahmoud
Hello
Mahmoud
As I see in many sources the code of depth first and breadth first but I didn’t understand the code well any suggestions from where I can understand well the code of depth first and breadth first .
Thank you !
Rahul
How to ise thread library in with mingw compulier i have getting an error
Anonymous
Anonymous
soheil
i install clang from script in their site - but now terminal cant find clang and cant run in terminal
soheil
klimi
soheil
klimi
soheil
klimi
soheil
soheil
soheil
everyone do it with different methods
klimi
klimi
Danya🔥
Danya🔥
And actually it needs C++17 now
Anonymous
Anonymous
And actually it needs C++17 now
C++17 is with LLVM 16. That I know for sure. For 15, it works with C++14. I thought they would move from C++11 directly to C++17. No point in switching to C++14 which had very minor additions on top of C++11
Danya🔥