SlideShare a Scribd company logo
1 of 2
Download to read offline
I have this error: variable std::stringstream ss has initializer but incomplete type stringstream
ss(line);
^
I do not undetstand what I did wrong I appreciate Thank you in advance!
And This is my code I have wrote:
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;
struct User {
string ID;
string First_Name;
string Last_Name;
string IP_Address;
};
void read_users(vector<User>& users) {
ifstream input_file("Users.csv");
string line;
while (getline(input_file, line)) {
User user;
stringstream ss(line);
getline(ss, user.ID, ',');
getline(ss, user.First_Name, ',');
getline(ss, user.Last_Name, ',');
getline(ss, user.IP_Address, ',');
users.push_back(user);
}
input_file.close();
}
void write_users(const vector<User>& users) {
ofstream output_file("sorted_users.csv");
for (const auto& user : users) {
output_file << user.ID << ',' << user.First_Name << ',' <<
user.Last_Name << ',' << user.IP_Address << endl;
}
output_file.close();
}
void bubble_sort(vector<User>& users) {
int n = users.size();
for (int x = 0; x < n - 1; x++) {
for (int y = 0; y < n - x - 1; y++) {
if (users[y].Last_Name > users[y + 1].Last_Name) {
swap(users[y], users[y + 1]);
}
}
}
}
int main() {
vector<User> users;
read_users(users);
bubble_sort(users);
write_users(users);
return 0;
}

More Related Content

Similar to I have this error variable stdstringstream ss has initi.pdf

Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & ExpressChristian Joudrey
 
Real Time App with Node.js
Real Time App with Node.jsReal Time App with Node.js
Real Time App with Node.jsJxck Jxck
 
C++ Course - Lesson 3
C++ Course - Lesson 3C++ Course - Lesson 3
C++ Course - Lesson 3Mohamed Ahmed
 
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter DataStax Academy
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfpratyushraj61
 
Sql Injection Attacks Siddhesh
Sql Injection Attacks SiddheshSql Injection Attacks Siddhesh
Sql Injection Attacks SiddheshSiddhesh Bhobe
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfShaiAlmog1
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelpauldix
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variablecaviar7571
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variablegueste832a8e
 
Include- Modularity using design patterns- Fault tolerance and Compone.pdf
Include- Modularity using design patterns- Fault tolerance and Compone.pdfInclude- Modularity using design patterns- Fault tolerance and Compone.pdf
Include- Modularity using design patterns- Fault tolerance and Compone.pdfRyanF2PLeev
 
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersDeveloping Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersSaeid Zebardast
 
Creating a Whatsapp Clone - Part XIII.pdf
Creating a Whatsapp Clone - Part XIII.pdfCreating a Whatsapp Clone - Part XIII.pdf
Creating a Whatsapp Clone - Part XIII.pdfShaiAlmog1
 

Similar to I have this error variable stdstringstream ss has initi.pdf (20)

Asp
AspAsp
Asp
 
Building your first Node app with Connect & Express
Building your first Node app with Connect & ExpressBuilding your first Node app with Connect & Express
Building your first Node app with Connect & Express
 
Real Time App with Node.js
Real Time App with Node.jsReal Time App with Node.js
Real Time App with Node.js
 
Week 12 code
Week 12 codeWeek 12 code
Week 12 code
 
C++ Course - Lesson 3
C++ Course - Lesson 3C++ Course - Lesson 3
C++ Course - Lesson 3
 
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter
 
Here is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdfHere is my code for a linefile editor import java.io.BufferedRea.pdf
Here is my code for a linefile editor import java.io.BufferedRea.pdf
 
Sql Injection Attacks Siddhesh
Sql Injection Attacks SiddheshSql Injection Attacks Siddhesh
Sql Injection Attacks Siddhesh
 
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
FNT 2015 PDIS CodeEU - Zanimljiva informatika - 02 Djordje Pavlovic - Live_ch...
 
Express JS
Express JSExpress JS
Express JS
 
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdfCreating a Whatsapp Clone - Part XIII - Transcript.pdf
Creating a Whatsapp Clone - Part XIII - Transcript.pdf
 
Django - sql alchemy - jquery
Django - sql alchemy - jqueryDjango - sql alchemy - jquery
Django - sql alchemy - jquery
 
Os Leonard
Os LeonardOs Leonard
Os Leonard
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
Building Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModelBuilding Web Service Clients with ActiveModel
Building Web Service Clients with ActiveModel
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variable
 
User variable and room variable
User variable and room variableUser variable and room variable
User variable and room variable
 
Include- Modularity using design patterns- Fault tolerance and Compone.pdf
Include- Modularity using design patterns- Fault tolerance and Compone.pdfInclude- Modularity using design patterns- Fault tolerance and Compone.pdf
Include- Modularity using design patterns- Fault tolerance and Compone.pdf
 
Developing Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginnersDeveloping Applications with MySQL and Java for beginners
Developing Applications with MySQL and Java for beginners
 
Creating a Whatsapp Clone - Part XIII.pdf
Creating a Whatsapp Clone - Part XIII.pdfCreating a Whatsapp Clone - Part XIII.pdf
Creating a Whatsapp Clone - Part XIII.pdf
 

More from sukhvir71

HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdf
HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdfHW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdf
HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdfsukhvir71
 
httpswwwcancergovnewseventspressreleases2020lung.pdf
httpswwwcancergovnewseventspressreleases2020lung.pdfhttpswwwcancergovnewseventspressreleases2020lung.pdf
httpswwwcancergovnewseventspressreleases2020lung.pdfsukhvir71
 
Human impacts on the environment Prepare a detailed present.pdf
Human impacts on the environment Prepare a detailed present.pdfHuman impacts on the environment Prepare a detailed present.pdf
Human impacts on the environment Prepare a detailed present.pdfsukhvir71
 
HR praclitioners are increasingly performing gender pay audi.pdf
HR praclitioners are increasingly performing gender pay audi.pdfHR praclitioners are increasingly performing gender pay audi.pdf
HR praclitioners are increasingly performing gender pay audi.pdfsukhvir71
 
Humans have contributed to the majority of carbon dioxide C.pdf
Humans have contributed to the majority of carbon dioxide C.pdfHumans have contributed to the majority of carbon dioxide C.pdf
Humans have contributed to the majority of carbon dioxide C.pdfsukhvir71
 
i A content box using the lttextareagt tag which sho.pdf
i A content box using the lttextareagt tag which sho.pdfi A content box using the lttextareagt tag which sho.pdf
i A content box using the lttextareagt tag which sho.pdfsukhvir71
 
HuDs and Autnorties 014 points graded networkx has an imp.pdf
HuDs and Autnorties 014 points graded networkx has an imp.pdfHuDs and Autnorties 014 points graded networkx has an imp.pdf
HuDs and Autnorties 014 points graded networkx has an imp.pdfsukhvir71
 
humans What does the sample suggest about the use of 986F .pdf
humans What does the sample suggest about the use of 986F .pdfhumans What does the sample suggest about the use of 986F .pdf
humans What does the sample suggest about the use of 986F .pdfsukhvir71
 
Hunger Games Catching Fire uso de medios digitales y socia.pdf
Hunger Games Catching Fire uso de medios digitales y socia.pdfHunger Games Catching Fire uso de medios digitales y socia.pdf
Hunger Games Catching Fire uso de medios digitales y socia.pdfsukhvir71
 
I need full assignment with every steps Write a program tha.pdf
I need full assignment  with every steps Write a program tha.pdfI need full assignment  with every steps Write a program tha.pdf
I need full assignment with every steps Write a program tha.pdfsukhvir71
 
I need an explanation for both the wrong and correct answers.pdf
I need an explanation for both the wrong and correct answers.pdfI need an explanation for both the wrong and correct answers.pdf
I need an explanation for both the wrong and correct answers.pdfsukhvir71
 
I need an explanation for the wrong and the correct answer .pdf
I need an explanation for the wrong and the correct answer  .pdfI need an explanation for the wrong and the correct answer  .pdf
I need an explanation for the wrong and the correct answer .pdfsukhvir71
 
I need help building a dictionary for the unique packets tha.pdf
I need help building a dictionary for the unique packets tha.pdfI need help building a dictionary for the unique packets tha.pdf
I need help building a dictionary for the unique packets tha.pdfsukhvir71
 
I need a help with a project I need to identify Grass lawn.pdf
I need a help with a project I need to identify Grass lawn.pdfI need a help with a project I need to identify Grass lawn.pdf
I need a help with a project I need to identify Grass lawn.pdfsukhvir71
 
I need an excel formula that will return 1 for HE17HE21 and.pdf
I need an excel formula that will return 1 for HE17HE21 and.pdfI need an excel formula that will return 1 for HE17HE21 and.pdf
I need an excel formula that will return 1 for HE17HE21 and.pdfsukhvir71
 
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdf
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdfHxxxp19x21 H5TNii5x21 c Why akould you espect th.pdf
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdfsukhvir71
 
I measured the cooling rate X and surface hardness Y of .pdf
I measured the cooling rate X and surface hardness Y of .pdfI measured the cooling rate X and surface hardness Y of .pdf
I measured the cooling rate X and surface hardness Y of .pdfsukhvir71
 
I need a Full Runnable code and UML Diagram for the followin.pdf
I need a Full Runnable code and UML Diagram for the followin.pdfI need a Full Runnable code and UML Diagram for the followin.pdf
I need a Full Runnable code and UML Diagram for the followin.pdfsukhvir71
 
How would you explain the statement that CPR should not be .pdf
How would you explain the statement that CPR should not be .pdfHow would you explain the statement that CPR should not be .pdf
How would you explain the statement that CPR should not be .pdfsukhvir71
 
i Local supranational and governmental organisations amp.pdf
i Local supranational and governmental organisations amp.pdfi Local supranational and governmental organisations amp.pdf
i Local supranational and governmental organisations amp.pdfsukhvir71
 

More from sukhvir71 (20)

HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdf
HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdfHW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdf
HW8 Concept Deep Learning Q1 Neural Networrks 2 Points Se.pdf
 
httpswwwcancergovnewseventspressreleases2020lung.pdf
httpswwwcancergovnewseventspressreleases2020lung.pdfhttpswwwcancergovnewseventspressreleases2020lung.pdf
httpswwwcancergovnewseventspressreleases2020lung.pdf
 
Human impacts on the environment Prepare a detailed present.pdf
Human impacts on the environment Prepare a detailed present.pdfHuman impacts on the environment Prepare a detailed present.pdf
Human impacts on the environment Prepare a detailed present.pdf
 
HR praclitioners are increasingly performing gender pay audi.pdf
HR praclitioners are increasingly performing gender pay audi.pdfHR praclitioners are increasingly performing gender pay audi.pdf
HR praclitioners are increasingly performing gender pay audi.pdf
 
Humans have contributed to the majority of carbon dioxide C.pdf
Humans have contributed to the majority of carbon dioxide C.pdfHumans have contributed to the majority of carbon dioxide C.pdf
Humans have contributed to the majority of carbon dioxide C.pdf
 
i A content box using the lttextareagt tag which sho.pdf
i A content box using the lttextareagt tag which sho.pdfi A content box using the lttextareagt tag which sho.pdf
i A content box using the lttextareagt tag which sho.pdf
 
HuDs and Autnorties 014 points graded networkx has an imp.pdf
HuDs and Autnorties 014 points graded networkx has an imp.pdfHuDs and Autnorties 014 points graded networkx has an imp.pdf
HuDs and Autnorties 014 points graded networkx has an imp.pdf
 
humans What does the sample suggest about the use of 986F .pdf
humans What does the sample suggest about the use of 986F .pdfhumans What does the sample suggest about the use of 986F .pdf
humans What does the sample suggest about the use of 986F .pdf
 
Hunger Games Catching Fire uso de medios digitales y socia.pdf
Hunger Games Catching Fire uso de medios digitales y socia.pdfHunger Games Catching Fire uso de medios digitales y socia.pdf
Hunger Games Catching Fire uso de medios digitales y socia.pdf
 
I need full assignment with every steps Write a program tha.pdf
I need full assignment  with every steps Write a program tha.pdfI need full assignment  with every steps Write a program tha.pdf
I need full assignment with every steps Write a program tha.pdf
 
I need an explanation for both the wrong and correct answers.pdf
I need an explanation for both the wrong and correct answers.pdfI need an explanation for both the wrong and correct answers.pdf
I need an explanation for both the wrong and correct answers.pdf
 
I need an explanation for the wrong and the correct answer .pdf
I need an explanation for the wrong and the correct answer  .pdfI need an explanation for the wrong and the correct answer  .pdf
I need an explanation for the wrong and the correct answer .pdf
 
I need help building a dictionary for the unique packets tha.pdf
I need help building a dictionary for the unique packets tha.pdfI need help building a dictionary for the unique packets tha.pdf
I need help building a dictionary for the unique packets tha.pdf
 
I need a help with a project I need to identify Grass lawn.pdf
I need a help with a project I need to identify Grass lawn.pdfI need a help with a project I need to identify Grass lawn.pdf
I need a help with a project I need to identify Grass lawn.pdf
 
I need an excel formula that will return 1 for HE17HE21 and.pdf
I need an excel formula that will return 1 for HE17HE21 and.pdfI need an excel formula that will return 1 for HE17HE21 and.pdf
I need an excel formula that will return 1 for HE17HE21 and.pdf
 
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdf
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdfHxxxp19x21 H5TNii5x21 c Why akould you espect th.pdf
Hxxxp19x21 H5TNii5x21 c Why akould you espect th.pdf
 
I measured the cooling rate X and surface hardness Y of .pdf
I measured the cooling rate X and surface hardness Y of .pdfI measured the cooling rate X and surface hardness Y of .pdf
I measured the cooling rate X and surface hardness Y of .pdf
 
I need a Full Runnable code and UML Diagram for the followin.pdf
I need a Full Runnable code and UML Diagram for the followin.pdfI need a Full Runnable code and UML Diagram for the followin.pdf
I need a Full Runnable code and UML Diagram for the followin.pdf
 
How would you explain the statement that CPR should not be .pdf
How would you explain the statement that CPR should not be .pdfHow would you explain the statement that CPR should not be .pdf
How would you explain the statement that CPR should not be .pdf
 
i Local supranational and governmental organisations amp.pdf
i Local supranational and governmental organisations amp.pdfi Local supranational and governmental organisations amp.pdf
i Local supranational and governmental organisations amp.pdf
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

I have this error variable stdstringstream ss has initi.pdf

  • 1. I have this error: variable std::stringstream ss has initializer but incomplete type stringstream ss(line); ^ I do not undetstand what I did wrong I appreciate Thank you in advance! And This is my code I have wrote: #include <iostream> #include <fstream> #include <vector> #include <algorithm> using namespace std; struct User { string ID; string First_Name; string Last_Name; string IP_Address; }; void read_users(vector<User>& users) { ifstream input_file("Users.csv"); string line; while (getline(input_file, line)) { User user; stringstream ss(line); getline(ss, user.ID, ','); getline(ss, user.First_Name, ','); getline(ss, user.Last_Name, ','); getline(ss, user.IP_Address, ','); users.push_back(user); } input_file.close(); } void write_users(const vector<User>& users) { ofstream output_file("sorted_users.csv"); for (const auto& user : users) { output_file << user.ID << ',' << user.First_Name << ',' << user.Last_Name << ',' << user.IP_Address << endl; }
  • 2. output_file.close(); } void bubble_sort(vector<User>& users) { int n = users.size(); for (int x = 0; x < n - 1; x++) { for (int y = 0; y < n - x - 1; y++) { if (users[y].Last_Name > users[y + 1].Last_Name) { swap(users[y], users[y + 1]); } } } } int main() { vector<User> users; read_users(users); bubble_sort(users); write_users(users); return 0; }