#include <cstdlib>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
int main(){
std::string note_str("72,74,76,77,76,74,72,0");
std::vector<int> notes;
std::stringstream ss(note_str);
std::string item;
while (std::getline(ss, item, ',')) {
if (!item.empty()) {
int noteno = atoi(item.c_str());
std::cout << noteno << std::endl;
}
}
}
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme