its only for 2 words in a name....john kennedy

On Tuesday, June 5, 2012 3:22:44 PM UTC+5:30, Prem wrote:
>
> More than a programming, I believe  this is a logical question. Some of 
> the assumption you can take into consideration is how many names a 
> particular person can possibly have. say, John F Kennedy, So, your array 
> now can't hold 3 names in two dimension, so what you wanna do, increase an 
> array of one more dimension? or make John F in one and kennedy in other. 
>
>  Now programming is fairly easy after you hv fixed your approach, alll you 
> have to do is make sure what goes in first dimension and what in second or 
> so.. and accordinly push it.
>
> Also I got confusion here are you expecting command like argument . as 
> givn in sample input, than use argv / argc .. why cout/cin !!! Anyway.. try 
> your luck !!
>
> BR,
> Prem
>
> On Tue, Jun 5, 2012 at 2:35 PM, daksh_ddt <[email protected]> wrote:
>
>> #include<conio.h>
>> #include<iostream>
>> using namespace std;
>> int main()
>> {
>>     char crew[2][2][10];
>>     cin>>crew[0];
>>     cout<<endl;
>>     cin>>crew[1];
>>     cout<<crew[0][0]<<crew[0][1]<<crew[1][0]<<crew[1][1];
>>     getch();
>>     return 0;
>> }
>>     
>> now if I give input jack sparrow robert langdon
>> crew[o][o] should be jack
>> crew[0][1] should be sparrow
>> crew[1][0] should be robert
>> crew[1][1] sbould b2 langdon
>> but this is incorrect
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Algorithm Geeks" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/algogeeks/-/1skPXOE7zboJ.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/35sjxYIwCRMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to