How to declare values of x and y into z? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to declare values of x and y into z?

#include <iostream> using namespace std; int main() { int x [2] = {1, 2}; int y [2] = {3, 4}; int z; return 0; }

6th Jun 2017, 11:11 AM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
32 Answers
+ 4
That's actually a short coming. But we cannot expect the top from a simple learning platform merely for beginners anyway. Perhaps in the near future, there will be a update to a advanced level, who knows...
6th Jun 2017, 2:10 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Make an array of z and then copy the values in the different cells like z [0] etc...
6th Jun 2017, 11:14 AM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
You need a way to store the values so you need a list or array to hold these. However you could create a database to hold your values but in order to manipulate them you will always need to construct arrays. Perhaps you tell me what you are planning to achieve or do?
6th Jun 2017, 12:04 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Why would you use this approach? Each of the letters has his own unicode value that you could use instead. Each letter Cap or small has a representative key on your keyboard that you could link with an ASCII code. I would use a SWITCH Case system for each letter with a condition that checks if the Cap key has been pressed or not to decide if you need a small letter of the Cap one. You see, this way you have only approximately 26 characters in Latin or 32 in Cyrillic. I don't know exactly how many char the Greek alphabet has, but I'm guessing 32 too?
6th Jun 2017, 12:33 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Let me ask you first, why the Greek alphabet consists out of two different sets of characters? Like the small and Caps should be equally ...? Secondly, Windows and Linux support Unicode and has actually nothing to do with SoloLearn because it is only a platform not an operating system. Don't ask me how, but I am sure you should be able to access Unicode by means of the proper library in C++, Java etc. but you could use a different approach. Do some research on the Internet, I'm almost sure you will find the header file you're looking for. How about you display a row with the explanation you want to supply just next to it ? Make it a scrolling list if you view should be limited. It is just an idea to skip the problem completely. Addendum You could shift your explanation into a Switch Case system easily.
6th Jun 2017, 1:32 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Why aren't there the same amount of characters in the Greek Alphabet for lower and upper case?
6th Jun 2017, 1:53 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
That's a pity to find out. I would have made sure Greek letters are supported because they are in use in several applications for certain formulas etc. Sorry that I'm not able to help you out, but is it necessary for SoloLearn or is this just to demo a code option ?
6th Jun 2017, 2:00 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Your level isn't important at all only your knowledge and your commitment to accomplish a goal without quitting before reaching the required results. However, your initial question is use an array... Good luck anyway and keep me posted, you made me curious!
6th Jun 2017, 2:18 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Btw are you really Greek living in Greece? What city and or Island ?
6th Jun 2017, 2:24 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Just tell me now and stop teasing me 😉😉😉😉😈😈😈😲😞😞😞😞
6th Jun 2017, 2:25 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Calispera my friend I didn't eat all day so I'm going to have some dinner now. Talk to you later
6th Jun 2017, 2:31 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Calinigta, calimera, and, and , I had a very close friend Greek friend in Sydney Australia. He actually thought me how to read Greek. I could read the newspaper but didn't understand what I was reading. So...
6th Jun 2017, 2:43 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Lookup my codes, I included a small sample of multidimensional arrays you could use those to store the two sets of alphabetical​ words in lower or upper case.
6th Jun 2017, 3:06 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 3
Ok, I tried something similar in a 3 dimensions array. You have to expand it by yourself, but you will get an idea. The first [] contains your option selection U = upper case , L = Lowercase. The two other lists contain in brackets the wording of the Greek letters in Upper or Lower etc... you should get the basics by now. Look at the C++ Lesson it is explained there too.
6th Jun 2017, 6:02 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 2
@Annatoli Because Sigma (Σ) has two small letters. (σ) when it's inside a word and (ς) when it's at the end of a word.
6th Jun 2017, 1:56 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 2
No not at all, but you're going to tell me anything about it I guess?😀😀😀😄😆👍👍✋👌
6th Jun 2017, 2:23 PM
🇺🇸 Anatoli🇧🇪🇪🇺 ,
🇺🇸 Anatoli🇧🇪🇪🇺 , - avatar
+ 1
Like int z [] = { x [0], x [1], y [0], y [1] }; ?
6th Jun 2017, 11:37 AM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 1
I have a class where in private I have two arrays. One for capital greek letters and one for small ones. And then in public I want the values of these to variables to be declared into another variable that holds all letters (capital and small).
6th Jun 2017, 12:08 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 1
Greek has 24 capitals and 25 smalls. SoloLearn doesn't support Unicode. Also I want to use that variable in int main () to give the ability to user input the letter he wants. Then the code will provide some information about the letter.
6th Jun 2017, 12:41 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar
+ 1
@Annatoli What do you mean with the first question ? I don't understand.
6th Jun 2017, 1:51 PM
Γιάννης Δημητριάδης
Γιάννης Δημητριάδης - avatar