Anonymous
Ok
Anonymous
Thank anywhere
Φ ☭
Immaterial
How to enable 802.11r using embedded C for router firmware ?
Talula
Anonymous
🔰Do you want to develop your CV, Projects with learning at a same time and get Internship. Do not waste your time thinking what to do next. We have great ideas for you. Contact me for further info🔰
Φ ☭
Jan
Do these advertising shits come by often?
Yasas
Bharti
#include<stdio.h>
int main(){
struct node{
int data;
struct node *next;
};
struct node *head,*newnode,*temp ;
head=0;
int choice;
while(choice){
newnode=(struct node *) malloc (sizeof(struct node));
printf("enter the data");
scanf("%d",&newnode -> data);
newnode -> next =0;
if (head==0){
head=temp=newnode;
}
else{
temp -> next = newnode;
temp = newnode;
}
printf("do you want to continue");
scanf("%d",&choice);
}
temp=head;
while(temp != 0)
{ printf("%d",temp -> data);
temp=temp -> next;
}
return 0;
}
Bharti
let me know the mistakes ...my program isnt running
Anonymous
Bharti
Anonymous
Thank you
Lol for what ? Btw what error are you getting.
Bharti
B220059_Subhra_Bhanja
#include <stdio.h>
#include <stdlib.h>
int a[3], b[3];
int i=0, j=0 ;
int compareTriplets (int a[], int b[]);
int compareTriplets (int a[], int b[] )
{
int m, n;
for(i=0;i<3; i++)
{
for(j=0; j<3; j++)
{
if (b[j] > a[i])
m++;
else if(a[i] > b[j])
n++;
}
printf("%d %d", m, n);
return 0;
}
}
int main() {
char temp1,temp2;
do {
scanf("%d%c", &a[i], &temp1);
i++;
} while(temp1 != '\n');
for(i=0; i<3; i++) {
printf("%d ", a[i], temp1);
}
do {
scanf("%d%c", &b[j], &temp2);
j++;
} while(temp2 != '\n');
for(j=0; j<3; j++) {
printf("%d ", b[j], temp2);
}
return compareTriplets( a[i], b[j]);
}
CAN SOMEONE FIX THIS?
Fix this please!🙏
B220059_Subhra_Bhanja
Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality, and difficulty.
The rating for Alice's challenge is the triplet a = (a[0], a[1], a[2]), and the rating for Bob's challenge is the triplet b = (b[0], b[1], b[2]).
The task is to find their comparison points by comparing a[0] with b[0], a[1] with b[1], and a[2] with b[2].
If a[i] > b[i], then Alice is awarded 1 point.
If a[i] < b[i], then Bob is awarded 1 point.
If a[i] = b[i], then neither person receives a point.
Comparison points is the total points a person earned.
Given a and b, determine their respective comparison points.
Question
Anonymous
i guys i need your help in a project
Anonymous
i have to program a simplified version of the Magic the Gathering (MtG) card game by Wizards of the Coast.
klimi
okay
Talula
Anonymous
klimi
klimi
I forgot
Anonymous
hhhhh
klimi
Gn
+
hey guys anyone have any example about how to create a dll in c++ I want to create a dll from a lzo compression function that does not available in lzo dll itself
Natasha
olli
hardin
I have manualy configured minGw to compile from VS code. Now am facing the broblem on adding 3rd party libraries. any one with vital information or idea
olli
hardin
Immaterial
Can anyone know embeded firmware design & development ??
Anonymous
//define token structure
typedef struct structure_token{
union token_value value;
enum token_type type;
struct structure_token *linked_token;
} * p_exp_token;
struct token_queue{
pfunc_token head; //create elements of token_queue
pfunc_token rear;
};
pfunc_token FUNCTION(struct token_queue *pqueue); //function prototype
/*
Function duty : remove element from the queue
Input
Output 1 if queue is not empty : address of pqueue->head
Output 2 if queue is empty : address of pqueue->head
*/
pfunc_token FUNCTION(struct token_queue *pqueue){
pfunc_token ptoken = pqueue->head;
if(pqueue->head){
pqueue->head=ptoken->linked_token;
if(ptoken==pqueue->rear)
pqueue->rear=NULL;
ptoken->linked_token=NULL
}
return ptoken; //return address of ptoken
}
Anonymous
Can you explain what is the duty of these piece of codes
Anonymous
I couldnt understand
Samvel
/get cbook
Aksa
Hi any coding helpers??
Anshul
in a vector why dont we push elements using cin, why do we use push_back
vector<int> a;
a.reserve(10);
for(int i=0;i<10;i++)
{
cin>>a[i];
}
for(auto x: a)
{
cout<<a[i]<<" ";
}
why this code don't work well??
Anshul
also explain what if i don't use a.reserve() here and repeat the same code!
Suka
Anshul
so i reserve memory equals to 10 here and when i am able to access elements of vector using [ ] then why i can't input using it! compiler don't give any error but it just don't print anything!
Suka
Anshul
alright! no problem
olli
Anshul
i was trying to prepare a grid of size n*m using vector. so i will first input n and m from user. then i try to create a temp vector n no. of times(number of rows of my grid) and in the temp vector i input "m" number of elements using cin.
Anshul
Anshul
also please tell me can i use a[i][j] to access i th row and j th column element in vector???? if yes why and how? and if no why not? i tried accessing element like this, compiler gives no error but it doesn't even print anything? please explain me why
olli
Anshul
yea sorry
Anshul
in the for each loop i put a[i] please consider it x
Anshul
in the for each loop i put a[i] please consider it x
#include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int> a;
a.reserve(10);
for(int i=0;i<10;i++)
{
cin>>a[i];
}
for(auto x: a)
{
cout<<x<<" ";
}
}
Anshul
Anshul
std::vector<std::vector<int>> V(n, std::vector<int>(m, 0));
Anshul
i have learnt that if i do this vector<int> a(m,0) , this means that this vector a will have m elements and all those will be zero. but if i want to put the elements of inner vector to zero then i don;t know how to do that. i.e. vector<vector<int>> b(n,0)
Anshul
alright! i understood it! thanks alot
Anshul
Anshul
ok so basically when i try to input elements using cin, it doesn't increase the size of the vector, that is why it doesn't print anything
Anshul
right??
Anshul
and push_back() increases size internally?
Pavel
Pavel
Anshul
so it's not a good practice to push elements into the vector using cin?? should i always use push_back() function????
Pavel
so it's not a good practice to push elements into the vector using cin?? should i always use push_back() function????
There's nothing bad with push_back elements, usage depends on the stored types.
If your types are not default constructable then you do push_back or emplace_back.
If you know the size in advance you can do reserve before adding elements, that's a good practice.
If your elements are default constructible (or better yet trivially constructible), you can do resize if you know the size in advance.
Also, for reading from cin, you can do.
vect.push_back();
std::cin >> vect.back();
Deven
If you are interested then please contact
Talula
/report
Talula
@chandradeepdey You look like Aziz Ansari
Anshul
Anonymous
so it's not a good practice to push elements into the vector using cin?? should i always use push_back() function????
std::basic_istream::operator>>() only extracts characters. it is not about being "good practice", it is about being impossible.
use this instead
std::istream_iterator<int> cin_iterator(std::cin), cin_end();
while (cin_iterator != cin_end) {
v.push_back(*cin_iterator++);
}
you should decide whether the cin_end is needed part based on the nature of the input. the ++ on the iterator is a no-op, but it is good practice to do it for consistency.
oh wait, std::cin >> int works. i am dumb
Anonymous
Good
Hello there, I am working on cpp project which has some dependency on SDk environment.Before running the CMake of the project I need to source the environment file which exports the paths
Good
Is there any way to select the SDK compiler In vscode instead of using regular gcc compiler?
Suka
+
Natasha
spartak
Hi everyone, what courses ( preferably on youtube) , books and sites can you recommend for beddiner in c++