Pavel
In that case the result case is showing null
#ot well, that's another issue, it's not C++ question, let's go to OT chat
systemQuery
Ok But I m doing it in c++ crud operation
systemQuery
The invite link shows expired
systemQuery
Any other link for ot
Nameful
talk to my boy Klimi
klimi
you are talking here... why have you pmed me that you cannot talk?
klimi
photos are not allowed in this group
Liang
#include <iostream> using namespace std; class node{ public: double data; node *next; }; node* createNode(double x){ node *newNode= new node; newNode->data=x; newNode->next=NULL; return newNode; } int main() { int inputL1[100],number1,inputL2[100],number2; cout<<"Input the number of list L1 nodes: "; cin>>number1; cout<<"Input the data elements of list L1 successively: "; for(int a=0;a<number1;a++){ cin>>inputL1[a]; } cout<<"Nodes of List L1 are: "; for(int a=0;a<number1;a++){ cout<<inputL1[a]<<" "; } cout<<endl<<"Input the number of list L2 nodes: "; cin>>number2; cout<<"Input the data elements of list L2 successively:"; for(int b=0;b<number2;b++){ cin>>inputL2[b]; } cout<<"Nodes of List L2 are: "; for(int b=0;b<number2;b++){ cout<<inputL2[b]<<" "; } node *L1=new node; node *L2=new node; for(int c=0;c<number1;c++){ node *newNode=createNode(inputL1[c]); L1->next=newNode; } for(int d=0;d<number2;d++){ node *newNode=createNode(inputL2[d]); L2->next=newNode; } return 0; }
Nameful
bruhhhh
klimi
but you can ask your doubts here
Liang
anyone help?
Nameful
anyone help?
looks like you got some C++ source code. that will be $10
Liang
?
Liang
$10?
Nameful
You need to copy the array
klimi
you will need to make a full copy of the data structure
Nameful
Since arrays just are pointers
Liang
how to link the L11 and L2?
Nameful
Space complexity?
Liang
L1 TO L2
klimi
indeed, you cannot store more information without increasing the space complexity
Nameful
oh, I see. You could use a data structure that only stores mutations to the array
Nameful
I forgot what those are called though
Liang
the question is L1, L2, L1, L2, L1 ,L2
Nameful
But they're popular in functional programming
Liang
something like that
Liang
why I cant send the picture?
Nameful
Pictures are scary
klimi
why I cant send the picture?
i worder, do you have the latest telegram?
Liang
i cant send picture on this group
Liang
Pictures are scary
your reply are more scary
Yazan
Hello guys
klimi
Hello guys
what do you need dear Yazan
Yazan
I have physics exam
Yazan
Is anyone interested in helping me please
Nameful
I have physics exam
But you choose to write C++ instead? Very relatable
klimi
Is anyone interested in helping me please
That would be cheating wouldn't it?
klimi
No it's helping
so its not an exam/homework/assigment/task that you are graded / is required by your institution?
Yazan
It is exam
Yazan
But I will need help in it
klimi
It is exam
why don't you ask you professor for help?
klimi
i am sure he will help you out
Liang
they are 13631 members here, seem like nobody here
z
It looks normal to me.
DELETED
/rules
Munaa
Hi I'm full stack developer junior student. I'm working on project where I do vary controlls on C. If there is someone can tell me how to control the input of string from the user ,the string must only contains big or small letter. Better if we use procedures or functions. Thanks in advance
@@♥️P...A..♥️
Welcome
.
Just a general topic can we get raw data from a graph plotted on a website which is interactive type If possible can some one guide me plzz
Anonymous
#include <stdio.h> #include <stdlib.h> int main() { int i=2,d=2; while(d<100) { if(i<=d) { if(d%i==0&&i==d) { printf("%d",d); i=2; d++; continue; } if(d%i!=0) { i++; continue;} else break; } } } Is above code correct for printing prime nos under 100
Munaa
do you want someone to do your homework for you?
Actually no I have done a good part and I'm blocked somewhere.
Anonymous
Actually no I have done a good part and I'm blocked somewhere.
https://www.geeksforgeeks.org/regular-expressions-in-c/
Munaa
https://www.geeksforgeeks.org/regular-expressions-in-c/
Isn't here what I'm searching.
Munaa
What I'm working on it is a big project. Let I explain the problems I get. I have an structure Typedef struct { Char name [DIM+1]; // dim is a macro }Example; Typedef struct { Example *example Int nElements }DynamicArray; You ask the user to enter his name, he\she can only input letters if the user puts show warning message and make to enter his\her name . Use Functions or procedures.
Munaa
I have used strcmp In for loop inside for loop I used if statement. And isn't working.
olli
I have used strcmp In for loop inside for loop I used if statement. And isn't working.
it's hard to tell what's wrong without seeing the code. After you read the string you can go over it and make sure every character is a letter. I don't think strcmp can really help you here.
Sivaprabu
#include <stdio.h> int main() { int inputValue = -1; if (!((inputValue == 0) || (inputValue == 1))) { printf("Error "); } return 0; } How to #optimize this code ? 😢
Merve
hellooo everyone, ı use uart interrupt, I get data of 7 bytes every 200ms. I want to assign this data to the array. but it doesn't work good.
Yasas
#ot
Merve
if (uart1_receive_flag) { uart_gelen[array]=uart1_receive_data; array++; uart1_receive_flag = 0; if(uart_gelen[2]==0x83){ P04=~P04; } if (sira>=8){ sira=0; }} }}
Merve
is there any problem at here
Pavel
#include <stdio.h> int main() { int inputValue = -1; if (!((inputValue == 0) || (inputValue == 1))) { printf("Error "); } return 0; } How to #optimize this code ? 😢
This can be simplified (not actually optimized, since the compiler will still optimize this for you). There's Boolean algebra that you probably learned or will learn in university that can help to understand how to simplify such expressions. Here's a cheat sheet: http://sandbox.mc.edu/~bennet/cs110/boolalg/rules.html Your expression in this math form is !(A + B) which by DeMorgan's law converts to !A * !B so the expression becomes if (inputValue != 0 && inputValue != 1)
Pavel
Thank you 👍
I haven't checked it, so I can be not right, you can check it easily by building a truth table https://en.m.wikipedia.org/wiki/Truth_table
Pavel
I haven't checked it, so I can be not right, you can check it easily by building a truth table https://en.m.wikipedia.org/wiki/Truth_table
Basically there are 4 possible variants (3 actually), for each of them for the original and simplified code the results should be the same
Anonymous
Can someone tell me how to take inputs in a string and then extract integers from that string in c++ please guide me For example : I want the user to imter values as -> 1,2,3,4,5 and then extract 1 2 3 4 and 5 from it
Anonymous
Einstein for example I want to take the input of Matrix elements from user but not one by one.... I want the user to enter the elements separated by a comma(,) Instead of entering like 1 2 3 4 5 6 I want him to enter 1,2,3,4,5,6 And then place those values in the matrix as 1 2 3 4 5 6
Sam
Anyone can give a c program to add two numbers without arguments and return types
Anonymous
#include<stdio.h> #include<math.h> int main() { float a,b,c,root1,root2,rootpart,denominator; printf("enter the value of a,b,c\n"); scanf("%f,%f,%f",&a,&b,&c); rootpart=sqrt(b*b -4*a*c); denominator=2*a; root1=(-b + rootpart)/denominator; root1=(-b - rootpart)/denominator; printf("ROOT1=%f ROOT2=%f",&root1,root2); } output is wrong for root of no.