Hello everybody, today my C++ teacher gave us an homework to do:
"Type a function that take in a string containing numbers and others characters and print on stdout all the numbers contained into the string, where for number is mean every maximal numerical sequence, of numbers not separed by spaces. Numbers printed on exit must be separated by commas. For example, if i put in the function the string "paje27hg78 2k f562" my function must print:
27, 78, 2, 562 "
So i started my code like so: (I WANT TO NOTICE THAT WE HAVE ONLY USED IOSTREAM AND FSTREAM LIBRARY FOR NOW, SO PLEASE DON'T USE OTHERS LIBRARY ELSE MY TEACHER WON'T CORRECT MY HOMEWORK!)
#include <iostream>
#include <fstream>
using namespace std;
void delete_words [] = {a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z};
Now depending on GCC version you need either select Have g++ follow the C++11 ISO C++ language standard (to enable C++11 if GCC version < 4.9), or create your own flag -std=c++1y (To enable C++14 if GCC version >= 4.9)
You need to specify path to gdb. If path on your computer is configured, then writing gdb in executable pat will be enough. Otherwise look where it is and enter path to it.
MiiNiPaa (6727)
replace {} with () on lines where error was.
Thanks to both of You, both codes are now working! If i want to delete the numbers and keep only the words i just need to change the numbers into the letters, right?