Anonymous
What does (:) mean in this for loop ?
Anonymous
And what is the the output?
Roxifλsz 🇱🇹
What does (:) mean in this for loop ?
It loops trough x and puts every value into y. The output is CPP!
Anonymous
Roxifλsz 🇱🇹
But the application has different answer
Oh shit :D I missed the part that all the cases have no break; statements
Anonymous
Anonymous
Prints CPP!
Anonymous
As no breaks
Anonymous
Nothing at 2. Not PP! at 3 .. P! at 7 and ! at 8
Anonymous
So CPP!PP!P!!
Anonymous
I need to know where we can use for(i:j)? What is this used for? And how this could be used?
Anonymous
Hello I'm a new student of computer science and I have a subject by the name of Programing I don't know any thing about it 😔 Please help me
Roxifλsz 🇱🇹
I need to know where we can use for(i:j)? What is this used for? And how this could be used?
When you need to iterate over all elements of an array, vector, etc.
Anonymous
When you need to iterate over all elements of an array, vector, etc.
So what will be value of i and j initially? Can you please provide a sample code?
Anonymous
Ok Thanks
Anonymous
So CPP!PP!P!!
But why case 1 printed once , case 2 twice , case 3 thrice and case 4 four times ? I didn't get it
Anonymous
Read what I wrote with patience
Anonymous
But the application has different answer
The elements in that array are from one to 10 But in switch case cases are for 1,3,7,8 ie case 1://something case 3: case 7: case 8: when y is passed as parameter to switch value stored y will be 1. So one switch case will match ie: "C" will be printed but there are no break statement after it so it prints letters from other cases as well. Until now CPP! will be printed. Now when y is incremented value of y will be 2 so there will be no match in switch case, then again when y will be incremented value of y will be 3 so again it will print anything written in case 3. As there are no break statements it will keep on printing letters until last case is not done. So now the letters CPP!PP! will be printed and this will be followed till end
Anonymous
/c_gcc@rextester_bot
Anonymous
/c_gcc@rextester_bot
Ok, give me some C_gcc code to execute
Anonymous
Ok, give me some C_gcc code to execute
void main() { int a; printf("%d",a); }
Anonymous
void main() { int a; printf("%d",a); }
How to execute the code I tried with a sample but nothing happened!
Anonymous
/vb@rextester_bot
Anonymous
/about@rextester_bot
Anonymous
/vb@rextester_bot
Ok, give me some Vb code to execute Changed your mind? /cancel
Anonymous
Created by @GingerPlusPlus, powered by rextester.com.
Anonymous
/cancel@rextester_bot
Anonymous
Anonymous
/cpp_gcc@rextester_bot
Anonymous
/cpp_gcc@rextester_bot
Ok, give me some Cpp_gcc code to execute
Anonymous
Ok, give me some Cpp_gcc code to execute
#include<iostream> Using namespace std; Int main (){ cout<<"hi"; return 0; }
Anonymous
/cpp_clang@rextester_bot
Anonymous
/cpp_clang@rextester_bot
Ok, give me some Cpp_clang code to execute Send it as text, or pass a file
Anonymous
Ok, give me some Cpp_clang code to execute Send it as text, or pass a file
#include<iostream> Using namespace std; Int main (){ cout<<"hi"; return 0; }
Anonymous
Is this you?
Anonymous
/ban soft porn
Anonymous
Anonymous
one is call by value and one is call by reference
Mr. COwO2 Preis
On (pc) you pass the value of pc into the function On (&pc) you pass the adress where the value is saved to the functiom
Mr. COwO2 Preis
yes
Mr. COwO2 Preis
Welcome
Anonymous
basically, in call by value .. the value of the argument is copied and execution is done on the copied value, hence no chnage in the original value. But in call by reference, the address is copied instead so all changes are made on the original value, it gets altered in this case.
M.Azam
Digital 24 hours clock😍
M.Azam
Anonymous
Anonymous
i dont get what you mean
Anonymous
struct *pc as an argument?
Anonymous
struct isnt a data type right?
Anonymous
i mean can you use it the way he is doing? never seen it that way
Anonymous
struct x and than x *pc is possible .. but sturct * pc ?
Anonymous
If you have Struct Pc pc being pc an instance of your struct Pc and want a pointer to the struct when you call your function you pass &pc and in the prototype yo write struct Pc *pc
Anonymous
I'm not quite sure about the prototype bc I always use typedef
Anonymous
Typedef struct Pc pc{ ... ... }Pc;
Anonymous
And create a variable like this: Pc pc;
Anonymous
but see what he did
Anonymous
function (struct* pc)
Anonymous
talking about the function declaration here
Anonymous
I'm not sure
Anonymous
Try it
Anonymous
Pc *pc would be fine
Anonymous
Try it
yeah gonna do
Anonymous
Try to use the typedefa is cleaner
Anonymous
function (struct* pc)
i just want to check this
Anonymous
i just want to check this
I think it should be struct nameOfStruct *pc
Anonymous
yeah thats what i was saying
Anonymous
function (struct* pc)
error: expected primary-expression before ‘struct’
GNU/Gurkirat
/cpp_gcc@rextester_bot
Anonymous
/cpp_gcc@rextester_bot
Ok, give me some Cpp_gcc code to execute
Anonymous
Ok, give me some Cpp_gcc code to execute
Anonymous
/csharp@rextester_bot
Anonymous
/csharp@rextester_bot
Ok, give me some Csharp code to execute
Liam
You should reply to it.
Nomid Íkorni-Sciurus
Error: main(): undeclared on line #1