No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
11 Posted Topics
How can i make sscanf() skip all whitespace characters?I read from a file and i dont know where are the characters. eg.->@Solomon Islands ,i need "Solomon Islands" in one string e.g->AGAF (AFT) – Afutara Airport – Afutara ,i need "Afutara Airport" in one string.
I would like to read a text file and store to strings some data that are important for me.I tried to do with strtok but wasnt successful?Can u help pls? [QUOTE]txtExample @Greece ASAS (FFF) - BLALAL BALLA BLALALAL - JAJAJAJAJ, XAKALXKAL ZMAH (AVK) – Arvaikheer Airport – Arvaikheer, Ovorkhangai ZMBH …
I've got this: [CODE]#include <iostream> #include <vector> #include <string> #include <cstdlib> #include <sstream> using namespace std; class alfa{ private: int x; public: alfa(){ cout<<"Dimiourgithike ena alfa"<<endl; x=rand()%10; } ~alfa(){ cout<<"Katastrafike ena alfa"<<endl; } void get_x(){ cout<<"To x exei timi: "<<x<<endl; } }; int main(){ alfa* alfadi; int no; cout<<"Dose enan …
I had this:[CODE]classA* class[10];[/CODE] But now i dont know the exact number(10) and i want to put a variable there and i get a compilation error.What i should do instead?
I have got this class:[CODE]class sample{ private: int number; string adress; public: int get_number(); string get_adress(); sample(); ~sample(); };[/CODE] I allocate dyanmically memory space like this(cause i need an array of pointers to obects):[CODE]sample** samples; samples=new sample*[20]; for(int i=0;i<20;i++){ samples[i]=new sample;}[/CODE] My question is how can i sort this array …
I need help cause i dont know how to use an array of pointer to classes. I've got in my main this: [CODE]gramma** letter;[/CODE] I have in an other class named classA this: [CODE]gramma** grammata;[/CODE] I construct in my main like this: [CODE]letter=new gramma*[number]; for(int i=0;i<number;i++){ letter[i]=new gramma(arithmos,&array);}[/CODE] What i …
[CODE]#include <iostream> #include <ctime> #include <cstdlib> #include <string> #include <vector> #include <fstream> #include <algorithm> using namespace std; class letter{ private: int genre; int price; string adress; public: letter(); ~letter(); }; class parcel{ private: int genre; int price; string adress; public: parcel(); ~parcel(); }; class post{ private: letter** LETTERS; parcel** PARCELS; …
1)How can i delete the memory allocated if i have allocated dynamically through "new" like that: classA** instances; instances=new classA*[5]; for(int i=0;i<5;i++){ instances[i]=new classA;} 2)How can i pass arguments on the constructor while i am allocating memory in this way?: classB* instances; instances=new classB[5]
How can i sort a vector which has strings and while sorting it to change data simultaneously in 2 other vectors? eg. vector 1 vector 2 vector 3 NewYork 25 1935 Athens 43 1990 I want it to be like this: Athens 43 1990 NewYork 25 1935 I want to …
I am a newbie and i am trying to sort an array of strings that i created using a vector<string> array by opening a file.Thx in advance...
I would like to open from a file and then store the strings stored in the txt filed to an array.The txt file i want to open has 1 string on each line.So each line will be 1 string.What should i change here? [CODE]// reading a text file #include <iostream> …
The End.
kavourdoukos