Nomid Íkorni-Sciurus
you'd need some quite complex processing to make it work your own.
Nomid Íkorni-Sciurus
the same applies to old stuff like GTK+ (which supports a subset of CSS)
Anonymous
Nomid Íkorni-Sciurus
because, as the compiler states, *pointer is definitely a rvalue (because you used ++)
Anton
Anton
Or there's no diff?
Nomid Íkorni-Sciurus
Anonymous
I'm using C
Doesn't matter. The pre-increment operator does not return a rvalue. It returns a lvalue
Anonymous
Anton
stear
Anton
Because I'm losing the sense on lvalue and rvalue... and thanks for your help :)
Nomid Íkorni-Sciurus
You should read about pointers.
int main() {
const char* ptr = "hello";
func(&(+ptr));
return 0;
}
Shouldn't this work too then?
Anonymous
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
Anonymous
Nomid Íkorni-Sciurus
No.
what's wrong about that?
Anonymous
what's wrong about that?
const int a = 10;
a = 5; //error
Here a is an lvalue but it can't be on the left side of an assignment
Nomid Íkorni-Sciurus
Anonymous
well because it's const
But you said lvalues can be on LHS of assignment operators. It is wrong because I gave you an example where it can't be
Nomid Íkorni-Sciurus
Nomid Íkorni-Sciurus
a is a lvalue, just it's const so you can't assign to it
Anonymous
Nomid Íkorni-Sciurus
I wanted to put it like in Math
Nomid Íkorni-Sciurus
left side of equation and right side
Nomid Íkorni-Sciurus
I thought it was the quickest way to explain it
Anonymous
ah, I meant expressions, not specifically an assignment
That is wrong still. In a = 5; a on LHS is a lvalue expression that can't be assigned to.
Lvalue refers to expressions that have both an identity and value. Rvalue refers to expressions that have just a value but not identity.
In C++, it is slightly more muddled with lvalues, glvalues, xvalues, rvalues and prvalues
Nomid Íkorni-Sciurus
Anonymous
~radhika♡
what is lvalue rvalue gvalue prvalue??
Nomid Íkorni-Sciurus
Anonymous
~radhika♡
aha okay thanks
KRYZ
Team mate, greetings to you all.
I'm a nubby in programming.
The gave us an assignment to write a mini calculator using functions for -, +, /, *, ln, exponential and log
KRYZ
I need help please
Anonymous
Anonymous
It's like, the very basics.
klimi
If they are stuck or have question its okay to ask tho ¯\_ (ツ) _/¯
Anonymous
How to create an html file
Aldrin
How to create an html file
Start Microsoft Word.
In the New Document task pane, click Blank Web Page under New.
On the File menu, click Save. NOTE: The Save as type box defaults to Web Page (*. htm; *. html).
In the File name box, type the file name that you want for your document, and then click Save.
Puspam
How to create an html file
Open an editor such as Notepad or VS code. Write something, then save it as filename.html
The .html should be there.
Suomy
Chinnu love to play games, one day Chinnu played a game in which she was given 'n' number of bits, where initially all bits are 0. Assume that the position of bits starts from 1 to n. Now, Chinnu has to traverse the bits 'n' times and flip in the following manner:
-> While traversing 1st time, flip the bits which are in the position multiple of 1.
-> While traversing 2nd time, flip the bits which are in the position multiple of 2.
-> While traversing 3rd time, flip the bits which are in the position multiple of 3 and so on till 'n' times.
Filp means if the bit is 0 flip it and make it 1 and if the bit is 1 flip it and make it 0.
The task is to print number of 1's and 0's after 'n' traversals.
For example assume that n=5, then the bits are initially
0 0 0 0 0
1st traversal -> 1 1 1 1 1 ( all positions are multiple of 1. i.e, filp all bits)
2nd traversal -> 1 0 1 0 1 ( positions 2 and 4 are multiple of 2. i.e, flip bits in position 2 and 4)
3rd traversal -> 1 0 0 0 1 ( position 3 is multiple of 3. i.e, flip bit in position 3)
4th traversal -> 1 0 0 1 1 ( position 4 is multiple of 4. i.e, flip bit in position 4)
5th traversal -> 1 0 0 1 0 ( position 5 is multiple of 5. i.e, flip bit in position 5)
After n traversals, the bits are 1 0 0 1 0. Here Number of 1's = 2 and Number of 0's = 3.
Anonymous
Anonymous
because `GitHub - rby90/project-based-tutorials-in-c: A `
Anonymous
lol
Phoenix
guys can anyone tell me
Phoenix
why this gives an error cout«arr[]; //if i have created an array arr[]=[1,2,3,4,5]; like this
Talula
why this gives an error cout«arr[]; //if i have created an array arr[]=[1,2,3,4,5]; like this
Are you using C++ or NodeJS?
You have to tell C++, which element of array you want to display, it'll not do it for you...
int main() {
int a[] = {1,2,4,5,6};
int size = sizeof(a)/sizeof(a[0]);
cout<<size<<endl;
for (int i = 0; i <= size-1; i++)
cout<<a[i];
return 0;
}
S__R
shriman_deepak
shriman_deepak
Either u have to specify which of the array u want to print
shriman_deepak
Or u have to use the for loop to print the whole array
Phoenix
Phoenix
Phoenix
Thanks for your kind responses guys.
Bereket
I need a suggestion for my final project and I want to make it simple.do anyone of you have a plan in mind?
Phoenix
#include<iostream>
using namespace std;
int main()
{
int i,N;
int arr[N]={};
//entering number of integers that arr will contain
cin>>N;
for(i=0;i<N;i++)
{cin>>arr[i]; //inputting arr elements
}
//for printing elements in reverse order
for(i=(N-1);i>=0;i--)
{cout<<arr[i]<<" ";
}
return 0;
}
for input
Phoenix
4
Phoenix
1 4 3 2
Phoenix
output is: 4 1
S__R
Phoenix
idk what's making this happen.There's something logically incorrect probably
Phoenix
Anonymous
Phoenix
it's a program to simply input array elements and then print them in reversed order but i m not getting it correct.
Anonymous
#include<iostream>
using namespace std;
int main()
{
int i,N;
//entering number of integers that arr will contain
cin>>N;
int arr[N]={};
for(i=0;i<N;i++)
{cin>>arr[i]; //inputting arr elements
}
//for printing elements in reverse order
for(i=(N-1);i>=0;i--)
{cout<<arr[i]<<" ";
}
return 0;
}
for input
Anonymous
Anonymous
Hi
Anonymous
I need an code for run length encoding
Anonymous
Can someone help me