Mat
D
D
klimi
Mat gn
Mat
See on yt videos about something similar already done. As an example, they discovered an NN guessing objects in an image basing the assumption only on the environment
Mat
Gn klimi
D
https://www.youtube.com/watch?v=aircAruvnKk&t=993s
Mat
@linuxer4fun what do you use to train your network? Hardware
D
klimi
Alignant
Anonymous
Anonymous
I mean ludovic's one
Ludovic 'Archivist'
Because if declared with parenthesis, it can be read as a function declarator, hence it is a function declarator
Alignant
Ludovic 'Archivist'
Ludovic 'Archivist'
Not calls
Alignant
Well, can you really confuse it? 😕
Alignant
Does
std::string str("lolkek");
look like a declaration? :D
Ludovic 'Archivist'
Language:
cpp
Source:
#include <vector>
int main() {
std::vector<int> a();
a.push_back(20);
}
Errors:
source_file.cpp: In function ‘int main()’:
source_file.cpp:5:3: error: request for member ‘push_back’ in ‘a’, which is of non-class type ‘std::vector<int>()’
a.push_back(20);
^
Note:
cplusplus_gcc assumed, other valid options are cplusplus_clang, visual_cplusplus, you can be more specific next time.
Alignant
You never need to leave the parentheses empty, if you want a default constructor, you don't need them
Ludovic 'Archivist'
Alignant
That's a bit lame, lol. But I see no reason to stop using parentheses if there is no danger having an ambiguity
Alignant
I mean, why use initializer list, if you don't need it :D
Ибраги́м
BinaryByter
BinaryByter
Wel i do have an idea
BinaryByter
One function requires iterators
BinaryByter
And that one's templated
BinaryByter
And has as many arguments as the function i want to call
Ludovic 'Archivist'
Ludovic 'Archivist'
std::vector<int> a ={} ;
This is an initializer list
BinaryByter
O
BinaryByter
Huh?
Anonymous
Can std::vector be used to created a multidimensional array
Anonymous
Can std::vector be used to created a multidimensional array
you could use std::vector of std::vectors
std::vector<std::vector<int>>
or if you want
template <typename T>
using dual_dim_array = std::vector <std::vector <T> >;
I don't know at which point this can be considered efficient
Anonymous
you may want to try to make your own container
Anonymous
Std::vector and new which is more efficient
Anonymous
those are different things and you should use vector to make a dynamic array
Anonymous
std::array if you don't need dynamic allocation and so avoid allocation costs
Anonymous
however if you are learning you can do your own implementation, but vector is efficient and safe for most applications
Anonymous
OK
AbdumajiD
Helo
Anonymous
Yeah
Anonymous
/
Anonymous
Ok
Marie
Purge complete.
Marie
King has 1/3 warnings... watch out!
Reason for last warn:
self-promotion
Anakin
#include<iostream>
using namespace std;
struct node
{
int data;
node* next;
};
class lili
{
public:
struct node* head,* tail;
lili()
{
head=NULL;
tail=NULL;
}
void add()
{
struct node* temp=new node;
int num;
cin>>num;
temp->data=num;
temp->next=NULL;
if(head==NULL)
{
head=temp;
tail=temp;
}
else
{
tail->next=temp;
tail=tail->next;
}
}
void display()
{
struct node* a;
a=head;
while(a!=NULL)
{
cout<<a->data<<"\n";
a=a->next;
}
}
};
int main()
{
lili o[10];
int n;
char ch;
cout<<"Enter element in the linked list\n";
do
{
o[n].add();
cout<<"Enter y/n to show the linked list\n";
cin>>ch;
n++;
}
while(ch!='y');
{
for(int i= 0;i<3;i++)
{
o[i].display();
}
}
return 0;
}
Anakin
please tell me what is wrong
klimi
What's the error
Anakin
Roxifλsz 🇱🇹
Roxifλsz 🇱🇹
You probably want to set it to 0
Anakin
yeah thankxx sir
Anonymous
What can be the use of this statement?
virtual void func()=0;
My CS teacher used that as an example to demonstrate abstract class...
Dima
yes it is
Dima
pure virtual function
Anonymous
What does it do?
Does it even have a body?
Dima
pure virtual function doesn’t have a body
BinaryByter
BinaryByter
stay away from OOP
Anonymous
Dima
don’t mislead newbies
Dima
you are not right
Dima
oop is good for start, later it need to go deeeper, e.g. DOD
BinaryByter
What? Why?
you will end up in a swamp full of nasty good
BinaryByter
there's a hole going through me spanning about 6 meters :)
BinaryByter
Google can
BinaryByter
Please pastebin, instead of three different screenshots
BinaryByter
also, tell us your compilation error
BinaryByter
you cannot use this in a class called anonymously
BinaryByter
instead of calling
class::function()
call
function()
BinaryByter
class::function()
calls the function like it was a normal, non classbound, function