Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~1K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Sunshine2011

I would like to use GTKmm within Codeblocks, so that everytime a new project is created, the libraries are automatically included. I think I have to tell Codeblocks under Settings/Compiler and Debugger/Search directories and then under compiler the includefiles and under linker the libs. Is that correct?

0
60
Member Avatar for Sunshine2011

#include <iostream> #include <vector> #include <iterator> using namespace std; class members { private: int Age; int Money; public: void setAge(int age) {Age=age;} void setMoney(int money) {Money=money;} int getAge()const {return Age;} int getMoney()const {return Money;} members(int age=0,int money=0): Age(age),Money(money) {} }; int main() { vector<members>v_members; for(size_t i=0,z=0;i<10;++i,++z) { if(z!=5) { v_members.push_back(members(50,70)); …

Member Avatar for Sunshine2011
0
219
Member Avatar for Sunshine2011

#include <iostream> using namespace std; class test { public: int bla(int &c); }; int test:: bla(int &c) { c=100; return c; } int main() { int c=10; test student; int b=1; switch(b) { case '1': cout<<student.bla(c); break; } cout<<c; return 0; } I would like to change the variable c …

Member Avatar for mitrmkar
0
130
Member Avatar for Sunshine2011

Hello, the following code doesn't work. The compiler gives the message: crosses initialization of 'std::ofstream filestream Maybe someone could explain the reason for this. switch(x) { case '7': ofstream filestream("Test.txt",ios::out|ios::app); //... break; case '8': cout<<This is a test."; break; }

Member Avatar for Ancient Dragon
0
93
Member Avatar for Sunshine2011

I wrote a little program to read soma data from a *.txt file. The content of the file is "5 , 10, 15". The program shall identify the numbers, e.g. "5" and "10" and "15". This works until the last two numbers. Unfortunately the program doesn't read the last two …

Member Avatar for DJSAN10
0
103
Member Avatar for Sunshine2011

[CODE] #include <iostream> #include <vector> #include <string> using namespace std; class Member { public: string Name,Vorname; //prototypes vector<Member>*generateAVector(); void SaveElementsInTheVector(vector<Member>*pAVec,Member *obj); void DisplayTheVector(vector<Member>*pTheVec); void test(); }; int main() { Member Neu; //new object //creates a vector on the heap, here with no sense,only experimentally vector<Member>*pAVec=Neu.generateAVector(); //puts data in the elements …

Member Avatar for Sunshine2011
0
117
Member Avatar for Sunshine2011

Hello, I wrote a little program (Create a vector and give it back via pointer.) for a better understanding of pointers. First it works but when I would like get access to the vector alloacated with "new", problems occur. For example saving a element is not possible. [ICODE] #include <iostream> …

Member Avatar for Fbody
0
228
Member Avatar for Sunshine2011

Within this code I would like to save the data which was input through a function "SavePlayer", but it doesn't work. The compiler "says" that object "a" ist not known. Probably the bold line [CODE][B][I]a.SavePlayer(manyPlayer,Player a); [/I][/B][/CODE]is wrong, but I have no idea how to solve the problem. Maybe someone …

Member Avatar for dluz
0
98
Member Avatar for Sunshine2011

Within a function a vector could be given back via "return". Example: [CODE] vector<int>myvector() { vector<int>myvector; return myvector; } [/CODE] Better would be to work with a reference, e.g.: [CODE] vector<int>(&myvector)() { vector<int>myvector; } [/CODE] But this reference doesn't work. Does anyone have an idea what the correct code would …

Member Avatar for vijayan121
0
156