Mr
Yea
Løstrëgõ
First line is 11 I think
Ah 1 then 1 1 the 1 2 1
Mr
Ah 1 then 1 1 the 1 2 1
for(int i=0; i <= max; ++i) cout << pow(11, i) << endl;
\Device\NUL
How is it in C?
printf("%f\n", pow(11, i)
Ибраги́м
https://www.nextptr.com/tutorial/ta1430524603/capture-this-in-lambda-expression-timeline-of-change
Ибраги́м
https://cdn.nextptr.com/images/uimages/SpPZ6mR7ZHbGok_e9eTsj902.png
alessandro
I have one question, it's little be complicated, does someone could help me?
neovstan
I have one question, it's little be complicated, does someone could help me?
You have an obligation to ask straightforward, specific questions that fully address the heart of the problem
alessandro
You have an obligation to ask straightforward, specific questions that fully address the heart of the problem
i need compare two datas, but it's one iterator..... do i need use overloading operator like <=?
Konstantin
i need compare two datas, but it's one iterator..... do i need use overloading operator like <=?
Clarify what you need to compare. Data or iterator? Bidirectional Iterators can be compared as is. Data from iterators can be compared as (*it1 < *it2).
alessandro
and then I use auto x = namefunction(data)
alessandro
and then I compare if (x->value > y->value)
Konstantin
and then I compare if (x->value > y->value)
How to get the value from subject? value_subject x; val = x->value; ?
Konstantin
yep
try if (*x->value > *y->value) it should work in my mind
Konstantin
Ok. Waiting for more skilled guys
alessandro
I figured out the problem
Anonymous
try if (*x->value > *y->value) it should work in my mind
It should be if ((*x)->value > (*y)->value) This would only work if *x returns a pointer or a class instance that has overloaded operator->. I am assuming that is the case here
Anonymous
https://www.nextptr.com/tutorial/ta1430524603/capture-this-in-lambda-expression-timeline-of-change
This is already in the resources section. :) https://t.me/cpp20programming/220
_amiretoon_
I don't understand your situation
Is it possible to locate a guy's location with c++ using his/her ip address?
alessandro
alessandro
so all tcp packs has metadata about start of route and end.
Anonymous
Is it possible to locate a guy's location with c++ using his/her ip address?
First of all, the IP address you get may not be actually the person's IP address unless you are establishing a direct connection to his computer. Most often the IP address you see will be that of an ISP remote hub (a NAT service provider) or maybe a VPN service provider. And with that IP address you can use Geolocation APIs to locate the IP address.
_amiretoon_
So the structure of an ip address from vpn,proxy or dns can not be even a little bit as same as that person's actual ip adress.
Anonymous
So the structure of an ip address from vpn,proxy or dns can not be even a little bit as same as that person's actual ip adress.
If I connect to a VPN service provider in Switzerland from my home in Africa, the IP address will be of the VPN provider in Switzerland.
klimi
I doubt that you can easily get it tho... i think it's implemented via lookup databases
Anonymous
I doubt that you can easily get it tho... i think it's implemented via lookup databases
https://developers.google.com/maps/documentation/geolocation/overview You can use this API
klimi
https://developers.google.com/maps/documentation/geolocation/overview You can use this API
well but i wouldn't consider this as "getting location via c++" this is getting it from google api
Anonymous
well but i wouldn't consider this as "getting location via c++" this is getting it from google api
Yes. That is what I suggested earlier to him. I suggested using some API instead. The C++ standard won't provide some facilities for this. Neither would the OS. You have to definitely use some 3rd party API
Chat Boss
Nothing sent a code, it has been re-uploaded as a file
Nothing
Nothing sent a code, it has been re-uploaded as a file
I need this to simulate rolling tow dice 100 times
Elias
Hello
Elias
Python and c++ what do they have in commn
klimi
Python and c++ what do they have in commn
they are modern programming languages
Elias
they are modern programming languages
Ok, how bout the performance
klimi
Ok, how bout the performance
since c++ is compiled it can be more fast, but under the hood python functions are c/c++ so with libraries like numpy python is only a glue between c++ calls (so it won't be that slow)
Elias
Umatiya
Means
zelika
can someone steer me to work ir sensor with stm32? anyone can text me. i need to help.
● Igor
hi, I'm reading "The C Programming Language" and this phrase is not 100% clear for me:
● Igor
"In the absence of explicit initialization, external and static variables are guaranteed to be initialized to zero; automatic and register variables have undefined (i.e., garbage) initial values." what are automatic variables?
Jose
_amiretoon_
I doubt that you can easily get it tho... i think it's implemented via lookup databases
Precisely Because of the combination it's hard to get a result.
Letа
Hello. I'm trying to implement Server and Client app in C The server must be able to handle multiple clients at once. The main task of the Server is accepting numbers from Clients and processing them. The server does not respond to clients but only works as a receiver. I'm new to socket programming and don't fully understand how to implement it correctly. But I read that when processing data from clients, it is better to use select (), and not threads. Is it so? What about multiprocessing + select()? Where can I read this without going too far into the theoretical basis. Where can I see realizations of productive servers?
Chat Boss
Aurora YxY sent a code, it has been re-uploaded as a file
Chat Boss
Aurora YxY sent a code, it has been re-uploaded as a file
Chat Boss
Aurora YxY sent a code, it has been re-uploaded as a file
Aurora
//Client.cpp #include "Init.h" #include <time.h> #include <stdio.h> int main (){ Init(); while (true) { sleep(1); printf("%p\n",*data_table->mem_pipe.data_pool); //segment fault } }
Aurora
//Server.cpp int main (){ Init(); while (true) { sleep(1); *data_table->mem_pipe.data_pool++; } }
Aurora
I don't know why
Aurora
Help me please
Chat Boss
Kriss Ny sent a huge message, it has been re-uploaded as a file class Solution { public: //Function to find maximum of each subarray of size k. ve..
\Device\NUL
I don't understand, why I am getting a segmentation error when I am trying to return v?
Why you not use push_back() instead of assign the temp vector ?
Kriss
Why you not use push_back() instead of assign the temp vector ?
I want to find max value in the subarray temp actually 😅
alessandro
you could sort just using iterator
alessandro
sort(vec.begin()+2, vec.end());
Dm
I want to find max value in the subarray temp actually 😅
possible reason for segmentation fault not returning value. when you create vector temp the inner array located in class vector could be lesser then 3 and that's why you just tried to get access to memory which isn't available for you program the easiest way to check my suggestion vector<int> temp {0, 0, 0};
alessandro
example
alessandro
std::vector<int> data = { 10, 9, 8, 7, 6}; std::vector<int> ::iterator it; it = std::max_element(data.begin() +2 , data.end()); std::cout << *it;
Kriss
i'm truly, why do you do so?
😅changed the code, it was surely overkill
Salman
this is the official c and c++ telegram grp?