coal
i'm reading more about this
coal
thank you for clearing my doubts
Leovan
int a[2][3] = ...;
What type of a pointer on a multidimensional array (a)?
It's not int *, because i need to cast it first, for example:
*((int *)a + i*3 + j) = a[i][j]
typeid says: A2_A3_i
Golden Age Of
Hsn
Hsn
Fuck The
How do I validate that the binary code of my compiled C or C++ application was not modified by some third party before sending data to a remote server?
coal
you want to check integrity
coal
cant you just generate a sha hash and then compare it
Fuck The
cant you just generate a sha hash and then compare it
You mean before sending a request to the server from my distributed app residing on the user’s computer, I will first calculate on the user’s computer the hash value generated from the app’s binary code and then send that code along with the request’s data to the server for validation and on the server side I will compare the generated hash on the user’s computer that was just sent with the hash that was already pregenerated for my original app and is already stored on my server?
coal
coal
the original binary and the user's binary
coal
simple integrity check principle
Hsn
Hsn
Hsn
So its the compiler who injects code of +3 ..
Anonymous
Anonymous
Sorry if completely unrelated but what are good resources for self-learning algorithms and data structures, preferably using c/c++?
Hsn
Make more sense because it would be disaster if it was array of pointers
Imagine how much wasted memory for
Char arr2D[1000][2];
Char (*ptr)[1000];
Hsn
Ashwani
#include<iostream>
using namespace std;
class B{
    public:
    virtual void s(){
        cout<<"In base"<<endl;
    }
};
class D{
    public:
    void s(){
        cout<<"In derived"<<endl;
    }
};
int main(){
    B *bptr;
    D d;
    bptr=&d;
    bptr->s();
}
Ashwani
Anonymous
Hsn
https://youtube.com/playlist?list=PLBlnK6fEyqRhX6r2uhhlubuF5QextdCSM
https://youtu.be/nvRkFi8rbOM
https://youtube.com/c/EricOMeehan
I find these are good for a start in c.
TheCherno is good c++ channel (i didnt see data struct or algo there).
Anonymous
Anonymous
What about new dev c++ versions?
Anonymous
Such as embarcadero dev c++
Anonymous
Ashwani
itsmanjeet
Hey, do anybody know the syntax for specialized template constructor
Google is not in the mood to answer,
I need something like
Class Value {
void* buffer;
MyType type;
template<typename T>
Value(T t) {}
}
So that if pass any int, long short or any integral value it will go for the constructor of int type
If i pass any float, double value that it will go for construct of float typw
Igor🇺🇦
itsmanjeet
sundeep
#include <bits/stdc++.h>
using namespace std;
vector<int> vectfunc(int arr[],int tn){
map<int,int> mp;
vector<int> v;
for(int i=0;i<tn;i++){
mp[arr[i]]++;
}
map<int,int> ::iterator it=mp.begin();
for(;it!=mp.end();it++){
if((it->second)>=2){
v.push_back((it->first));
}
}
return v;
}
int main() {
// your code goes here
int n1,n2,n3;cin>>n1>>n2>>n3;
int tn=n1+n2+n3;
int arr[tn];
for(int i=0;i<tn;i++){
cin>>arr[i];
}
vector<int> vect=vectfunc(arr,tn);
for(int i=0;i<tn;i++){
cout<<vect[i]<<endl;
}
return 0;
}
sundeep
Can anyone say . Whats wrong in my code
Captain
Hima
数学の恋人
class Instruction {
protected:
type::byte opcode;
type::byte cycles;
std::string name;
public:
// constructor
Instruction(type::byte ins_opcode, std::string ins_name,
type::byte ins_cycles)
: opcode{ins_opcode}, cycles{ins_cycles}, name{std::move(ins_name)} {};
};
Why does compiler warn me about opcode, cycles and name being protected?, why do we have those access specifiers if I can't have members as those?
Compared to above....
class Instruction {
private:
type::byte opcode;
type::byte cycles;
std::string name;
public:
// constructor
Instruction(type::byte ins_opcode, std::string ins_name,
type::byte ins_cycles)
: opcode{ins_opcode}, cycles{ins_cycles}, name{std::move(ins_name)} {};
inline type::byte get_opcode() const { return opcode; }
inline type::byte get_cycles() const { return cycles; }
};
Is this way more preferable and better/safer/whatever?
sundeep
for(int i=0;i<tn;i++){
cout<<vect[i]<<endl;
}
sundeep
Got error
sundeep
In for loop . I should use vect.size instead of tn
sundeep
sundeep
If I send question link here . It's getting deleted
Hima
Anshul
I'm not able to understand the intuition behind Euclid's algorithm. I.e. gcd(a,b)=gcd(b,a%b)
Can anyone help me understand the intuition
Anshul
Melbgm
Can't I write like this?
gives an unresolved exclude error
Melbgm
didn't copy the functions
Pavel
the code that you pasted looks fine, maybe the error in other parts of the code? Did you implement all the functions and declared them before main?
Melbgm
Yes i think so
Leovan
Anonymous
folks, how to learn gcc effectively
Anonymous
I feel it hard
Syed
hello
Syed
anybody knows how to build symbol table in c++
S__R
You taking integer value from user and using char in switch
Prince Fine
Welcome
But don't forget to
Read the rules
coal
Anonymous
Anonymous
yeah
Mostakim
how to sort 3numbers in ascending order? can anyone suggest a easy method for do this?
Mikhail
tb
/get cppbookguide
Melbgm
Abdelrhman
I need some help
Abdelrhman
Can anyone help me in c++ program mming
Abdelrhman
?
Abdelrhman
Programming
Anonymous
Making windows apps using managed C++ is an option but it is nothing as friendly as C#. Know the domain you are going to be working on. If it is something that involves heavy GUI work on Windows then learning C# is a good investment. You have other alternatives but C# is the best out there and as a language C# is much better designed when compared to C++ (managed or otherwise)
tb