+ 1
C program
Can i have some help here please I have set of string elements assume it orange , cucumber,apple,kiwi how can i do c programming that take from user any set of the strings like that and assign every element of this set to index of array in ascending order ( first input by user first be indexed in array ) thanks for advance!
11 Answers
+ 2
you can use a pointer to a pointer, pointer to an array or a 2d array then sort it in which ever order you want
+ 1
devanille thanks 😊 i really from my heart appreciate your help thanks again ❤️❤️❤️
+ 1
I have not understood your question properly give a explanation of input and output formate
+ 1
ebrahem hesham here is your answer i tried in cpp u can make in c . i hope u expect same output which i made.
#include <iostream>
using namespace std;
int main()
{
const char *colour[4] = { "Autumn", "Winter", "Summer", "Yellow" };
for(int i=0;i<3;i++)
{
cout << colour[i] <<"-"<<i<<"\n";
}
return 0;
}
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 how can I do that ? The program i wanna do should solve two things the string that entered should be in punch of chars not only char and the second is to determine index to each element of this set strings
0
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 what i attempt to do is when you enter the index of the string you get one of these elements defined in array which will retrieve the string name element belongs to that index like that
Enter number to see :
3
Your color is "blue"
0
C,Cpp,Java,Html.
How can I have set of strings ordered by index in an array in c instead of having characters only in indexing
Input
Spring , Autumn,winter, summer
Output :
Enter the seoson you need
2
Result
The seoson is summer .
0
C,Cpp,Java,Html.
Thanks 😘