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)
Nomid Íkorni-Sciurus
It should still work unless you made a mistake somewhere else.
it can't work &++pointer is like &324242 which doesn't reside in a memory cell
Nomid Íkorni-Sciurus
because, as the compiler states, *pointer is definitely a rvalue (because you used ++)
Anonymous
it can't work &++pointer is like &324242 which doesn't reside in a memory cell
#include <iostream> void func(const char** ptr){ std::cout << *ptr << std::endl; } int main() { const char* ptr = "hello"; func(&++ptr); return 0; }
Anton
Or there's no diff?
Nomid Íkorni-Sciurus
I'm using C
shouldn't be an issue
Anonymous
I'm using C
Doesn't matter. The pre-increment operator does not return a rvalue. It returns a lvalue
Anonymous
wait ++pointer makes pointer, not long ?
You should read about pointers.
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?
Nomid Íkorni-Sciurus
The unary + does not return a lvalue
ohhhh I see what you mean
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
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
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
the fact that you can't assign to a const doesn't mean that const is not a lvalue
Nomid Íkorni-Sciurus
a is a lvalue, just it's const so you can't assign to it
Anonymous
Nomid Íkorni-Sciurus
I never said it is. You did by saying lvalue = rvalue
ah, I meant expressions, not specifically an assignment
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
Anonymous
why do you say that? int a = 5; a = 7; maybe I'm not getting what you're trying to say
I was referring to a where it is defined as a const int and not a plain int
~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
Pavel
I need help please
What kind of help you need?
Anonymous
It's like, the very basics.
VladV1V
I need help please
Try yourself first
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
https://github.com/rby90/Project-Based-Tutorials-in-C
thought that said project-based-tutorials-in-A
Anonymous
because `GitHub - rby90/project-based-tutorials-in-c: A `
Anonymous
thought that said project-based-tutorials-in-A
Well, afaik there was only a B language, which has hobby compilers still, but not an A language lol.
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
why this gives an error cout«arr[]; //if i have created an array arr[]=[1,2,3,4,5]; like this
https://www.google.com/amp/s/www.geeksforgeeks.org/arrays-in-c-cpp/amp/
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
https://www.google.com/amp/s/www.geeksforgeeks.org/arrays-in-c-cpp/amp/
I m learning from there already.Some theory part.
Phoenix
Or u have to use the for loop to print the whole array
Ok.I just wanted to confirm is there any way to print out the whole array like this.If not what's the problem actually. Well i am aware of traversing the array through loops.
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
Phoenix
idk what's making this happen.There's something logically incorrect probably
Phoenix
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
Hi
Anonymous
I need an code for run length encoding
Anonymous
Can someone help me
Anonymous
Can someone help me
Search on google you will get it with explanation