Anonymous
does any one know how to solve this in c++?
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
Lakshmanan
Thank you I am very glad to join this group
Lakshmanan
Anybody can give some notes about c++
Anonymous
Thank you am happy having join the group of great minds
Dima
lol
Lakshmanan
Sorry guys I shared it to another group but wrongly click ed this group sorry.....
Dima
sure
Lakshmanan
Sure
Lakshmanan
Any body sent me some c++programme
Dima
no
Lakshmanan
I am just a beginner
Lakshmanan
no
🥺🥺🥺
Lakshmanan
Thanks
Anonymous
what is char buffer[256]; please explain this in easy lang
Dima
lol
Dima
learn some basics first
Anonymous
The code can talk itself
Anonymous
it's a buffer!
yeah but it actually do?
Anonymous
I am doing socket programming, so what it mean how it works?
Nameful
yeah but it actually do?
a buffer is something you store data in
Nameful
can be anything
Anonymous
thanks, got it
Anonymous
Which operator+, if any, is selected for each of the addition expressions? List the candidate functions, the viable functions, and the type conversions on the arguments for each viable function: struct SmallInt { SmallInt(int); operator int() const { return val; } private: std::size_t val; }; SmallInt operator+(const SmallInt&, const SmallInt&); struct LongDouble { LongDouble operator+(const SmallInt&); LongDouble(double = 0.0); operator double(); operator float(); }; LongDouble operator+(LongDouble&, double); SmallInt si; LongDouble ld; ld = si + ld; ld = ld + si; https://github.com/chandradeepdey/C-_Primer_5th/blob/master/14/14.52.txt someone please verify my answer, overload resolution is causing brain damage ;-;
Pawan
/try
Anonymous
Hi guys , glade to be one of you Please can any one send me courses or something so i can get to understand c++
Anonymous
Thanks
Anonymous
ye i know this. but the question asks to provide the list of candidate functions and viable functions.
Anonymous
? i didn't list the 2nd case as ambiguous. just that all of the candidates are viable
Anonymous
ye. i wanted to know if i missed any candidates or listed extra
Anonymous
okay
MᏫᎻᎯᎷᎷᎬᎠ
MᏫᎻᎯᎷᎷᎬᎠ
I am doing socket programming, so what it mean how it works?
In that case The code is probably reading the data stream coming from the socket
Anonymous
Hi guys. Could you tell why this code does not work on x64? And why is number 4 in the fourth line? double sum4(char *type, ...) { char * type_pointer = (char*)&type; type_pointer += 4; for (int i = 0; *(char*)type != 0; i++) { switch (*(char*)type) { case 'i': printf("| %-5d |\n", *(int*)type_pointer); type_pointer += sizeof(int); break; case 'd': printf("| %lf |\n", *(double*)type_pointer); type_pointer += sizeof(double); break; } type++; } }
Anonymous
i was looking for it. I have no idea
Anonymous
What I'm doing wrong ??
Anonymous
can i make it versatile for both architectures?
Anonymous
i can't use va. The function adds numbers depending on the type sum4("idiid", 2, 1.25, 5, 8, 9.21);
Anonymous
it's not a fully written function. i want to solve architectural dependency
Anonymous
I shouldn't use varargs in this task.
Anonymous
with inline asm ?
Anonymous
only with it?
Anonymous
thanks. what about ia32? i don't understand why +4?
Anonymous
but it does not depend on the number of types passed to the function
Anonymous
like "idiid" or "idiiddidididid" it's still +4
Anonymous
I understood everything. Thank you very much for your explanation
Anonymous
you helped me a lot
Anonymous
thanks a lot for your help
MᏫᎻᎯᎷᎷᎬᎠ
Make C++ great again
MᏫᎻᎯᎷᎷᎬᎠ
Lunatic trump
Anonymous
good month «Ramadan»❤
Dima
yeah don’t eat and suffer
Taylor Rose
help me with the lists, I need to sort the address alphabetically, but I get this:
Taylor Rose
#include <iostream> #include <string> #include <limits> #include <cstdlib> #include <list> using namespace std; struct A { string Last_name; string Adress; int Salary; void Input(A &a); A *next; }; class List { A *Head; A *Tail; public: List() {Head = NULL;} ~List(); void Add_element(A &a); void show_element(); }; void A::Input(A &a) { cout << '\n'; cout << "Your Name: "; getline(cin,Last_name); cout << "Your Adress: "; getline(cin,Adress); cout << "Your Salary: "; cin >> Salary; cin.ignore(); } List::~List() { while(Head != NULL) { A *temp = Head->next; delete Head; Head = temp; } } void List::Add_element(A &a) { A* temp = new A; temp->next = Head; temp->Last_name = a.Last_name; temp->Adress = a.Adress; temp->Salary = a.Salary; Head = temp; } void List::show_element() { A *temp = Head; while(temp != NULL) { cout <<"Your Name: " << temp->Last_name << endl <<"Your Adress: " << temp->Adress << endl <<"Your Salary: " << temp->Salary << endl; temp = temp->next; cout << endl; } cout << endl; } int main(int argc, char *argv[]) { A struct_a; int n ; List lst; cout << "Enter the number of times you want to fill in the data of the structure: "; cin >> n; cin.ignore(); for(int i = 0; i < n; ++i) { struct_a.Input(struct_a); lst.Add_element(struct_a); } cout << endl; lst.show_element(); return 0; }
Taylor Rose
how to do it?
Anonymous
Sorry, my phone developed a mind of its own and sent the last message
coding
CamScanner 04-24-2020 02.25.11 - Page 1.pdf
coding
CamScanner 04-24-2020 02.25.11 - Page 1.pdf
Please help me to solve this using c language..
Anonymous
Please help me to solve this using c language..
Do you want us to write code for you?
coding
Yes..
Anonymous
Yes..
/warn solution asking
coding
/warn solution asking
I am new here.. Isn't it allowed?
Anonymous
Anonymous
Lol
Anonymous
Hey, Which is the correct way to delete in queue in C? 1. Increase front value after deleting 2. shift all value by 1 to left after deleting, so front will remain 0 and rear will decrease by 1
Francisco
Hey, Which is the correct way to delete in queue in C? 1. Increase front value after deleting 2. shift all value by 1 to left after deleting, so front will remain 0 and rear will decrease by 1
You may want a circular queue, but the C++ way is using a special data structure called deque, which has constant (push/pop)_(front/back)
Anonymous
Hello
Anonymous
Hey, Which is the correct way to delete in queue in C? 1. Increase front value after deleting 2. shift all value by 1 to left after deleting, so front will remain 0 and rear will decrease by 1
I think both are correct. It depends on which implement you choose, the first one is probably used in list, and the second one might be used in array with circular index, which is the front index.
Anonymous
https://youtu.be/A_RT3EIP4Zo
.
Good
MᏫᎻᎯᎷᎷᎬᎠ
Anonymous
❤❤
Anonymous
When you are kind to others, it not only changes you, it changes the world. Harold Kushner
Kanahaiya
//program for sorting an array #include <iostream.h> #include<conio.h> int main( ) { int arr[10],i,j,temp; cout<<"enter 10 numbers to be sorted \n"; for(i=0;i<10;i++) { cin>>arr[i]; } cout<<"array is "; for(i=0;i<10;i++) { cout<<arr[i]; cout<<"\n"; } cout<<"sorted array is \n"; for(i=0;i<10;i++) { for(j=1;j<10;j++) { if(arr[i]>arr[j]) { temp=arr[j]; arr[i]=arr[j]; arr[j]=temp; } } } for(i=0;i<10;i++) { cout<<arr[i]<<"\n"; } }
Kanahaiya
I tried to sort an array
Kanahaiya
Write this program