#include<iostream>
#include<vector>
#include<string>
#include<stdio.h>
using namespace std;
vector<string>sort_strings(vector<string>strings){
int smallest=0;
for(int i=0;i<strings.size();i++){
for(int j=i;j<strings.size();j++){
if(strings[j].compare(strings[smallest])<0)
{smallest=j;}}
if(smallest!=i){
swap(strings[i],strings[smallest]);}}
return strings;}
int main(){
vector<string> s={"ISE","BSCE","BMC","BL","EDUC","BACT"};
cout<<" The programs names Before sort:"<<endl;
for(int i=0;i<s.size();i++){
printf()(s[i]);}
vector<string> sorted_strings=sort_strings(s);
cout<<"\n The programs names after sort:"<<endl;
for(int i=0;i<s.size();i++){
printf()(sorted_strings[i]);
}
return 0;
}
I want to print the string matrix using the print function "printf()" or another print function not using "cout"
I tried to do this but errors appeared in the code editor
So that the elements of the matrix appear under each other
thank you very much