+ 2

Help with dynamic matrix

I need to wtite dynamic matrix in which i need to enter words and if word will appear for the second time the programme will stop and show the word matrix.

25th Sep 2017, 1:01 PM
Jimmy Pub
Jimmy Pub - avatar
10 Answers
+ 8
@Jimmy Pub Ill just post a solution. Please wait... EDIT : Here is the Solution - https://code.sololearn.com/cPVS56SeJCWz/#cpp On SoloLearn's Code Playground, you will have to input any number of strings and then click run when done. The output however, will be all unique strings till the first repetition / match is received.
26th Sep 2017, 4:48 PM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 5
Can you provide a sample input and output as well? I am unable to fully understand what you need to do. Ill try my best to help.
26th Sep 2017, 4:54 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 5
I have guessed the following as your requirement - : Sample Input : Hello World New I am Hello //Stop here. Sample Output : Hello World New I am
26th Sep 2017, 4:56 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 5
@Jimmy Pub Classes? Why do you need classes for this simple code? Well, but if you have a requirement, you may declare a string class and use it instead of char* (Also define overloaded == and = operators in the same), or use the standard string class from C++03...
27th Sep 2017, 3:26 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 3
@Jimmy Pub Sorry I got lost. Ill add comments in a new code so that its easier for you to understand... One more thing. Do you have to create a class yourself or just use an existing one? As there is a nice string class built for us by C++03 developers... If you want a new class, let me know... And please tell me what all you were not able to understand from the code...
3rd Oct 2017, 1:11 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
+ 2
Yes
26th Sep 2017, 4:19 PM
Jimmy Pub
Jimmy Pub - avatar
+ 2
I just started learning OOP including pointers and "new" and i get this question but i don't know how i should do this
26th Sep 2017, 4:31 PM
Jimmy Pub
Jimmy Pub - avatar
+ 2
@Kinshuk Vasisht Okay,ty
26th Sep 2017, 4:33 PM
Jimmy Pub
Jimmy Pub - avatar
+ 2
Okey,but how do this in classes ?
26th Sep 2017, 9:11 PM
Jimmy Pub
Jimmy Pub - avatar
+ 1
Caz it's my homework ) For u it's ez but i i don't understand half of this code :
2nd Oct 2017, 11:12 PM
Jimmy Pub
Jimmy Pub - avatar