siddhant3s 1,429 Practically a Posting Shark

Do one thing:
Go to the compiler and just try to comment out the line ifstream inFile; Check if it runs or not. If it does, tell us. If it doesn't Try to comment-out #include <fstream> .
If it now runs, tell us. If it doesn't, there is some problem in your compiler or perhaps the linker as it cannot run a simple helloworld program.

siddhant3s 1,429 Practically a Posting Shark

Your work doesn't impressed me:

>How do you open a text file in C++?
>What function do you use to store a piece of text from the text file as an
array/string.
Did you bothered to open your text book or open a search engine and search it?
RTFM and STFW

>Is there a better way of doing this than what I am thinking of doing below?
Your code is actually doing nothing. Anyone who knows how to print the screen using cout and use a if statement can write that code. Your code doesn't involve even the header file need for File IO. This shows that you have not devoted enough time at your lectures/Book/internet.

Another advice. Please read http://www.catb.org/~esr/faqs/smart-questions.html to get spontaneous replies to your queries.
BTW, for the answer : click here

siddhant3s 1,429 Practically a Posting Shark

Do the following:
1.Make a new node temp and store x in temp->info.
2.Set temp->link = here->link
3.Set here->link = temp
Thats it
As you might have suspected, you don't require first as an argument, hence the definition of insert should loop like: void insert(node *here, int x)

siddhant3s 1,429 Practically a Posting Shark

>Here we have a system that does not emit vibrations of this kind and, as far as
>I know, could not emit vibrations of any kind.
Don't try to go to the classical model again. That is, if a (charged) particle is not emitting any radiations, it is not vibrating. This assertion is not valid in quantum mechanics (say, if this was true, there would be no atoms since they are vibrating but doesn't give out radiation in stable state).
I fully agree that the system at zero kelvin cannot give out any EM radiations(or any other way in which its energy decreases). But that doesn't implies that it would not be vibrating!
So I can infer is:
1. All particle will vibrate (at least move),
2. Even at zero kelvin.

siddhant3s 1,429 Practically a Posting Shark

My explanation is perfectly valid for perfect particles and even real particles.
You have defined zero kelvin as the temperature at which all the motion ceases. But actually, this very definition is not correct as viewed by the spectacles of quantum mechanics.
>This implies that if we were to send the crystal lattice to a 'massage parlor' it
>would end up with zero entropy at zero temperature.
Not likely, the Residual Entropy is the consequence of the basic arrangement of poly-atomic molecules. That mean, that even if you send your latice to a perfection parlor, they would still have residual entropy left.(Until and unless they are broken into individual atoms).

>WRT your avatar.
Didn't got this one? My avatar is the Glider, emblem of Hackerdom as suggested by Eric S. Raymond.
Yes, it is taken from Game of Life

siddhant3s 1,429 Practically a Posting Shark

>but you guys, when I enter the number, it doesn't show correctly
It shows correctly on my machine. Here is the code I used:

#include <iostream>
#include <stdlib.h>
using namespace std;

void GetTime ( int*, int*, int* );
int CalcSeconds ( int, int, int );

int main()
{
    int hr, min, sec;
    char another;
    int total_sec;

    cout << " \n\n Welcome to a time-conversion program ! \n\n " ;

    do
    {
        GetTime( &hr,&min, &sec);
        total_sec = CalcSeconds( hr, min, sec);
        cout << "\n\n You entered " << hr << ":" << min << ":" << sec;
        cout << "\n It is" << total_sec << " seconds " ;

        cout << "\n\n Do another ? y or n ";
        cin >> another ;
    }
    while ( another == 'y'|| another =='Y');
    cout << "\n THanks for playing! \n ";
    return 0 ;
}
void GetTime ( int *h_ptr , int *m_ptr, int *s_ptr)
{
    int ask_them_again = 1;
    char colon;
    while ( ask_them_again ==1 )
    {
        cout << " \n Please enter the time in hours minutes second";
        cout << " \n Such as 4:15:34 ( Note : Minutes and Seconds < 60 ) \n\n==> ";
        cin >> *h_ptr >>*m_ptr >> *s_ptr;
        ask_them_again =0 ;

        if ( (*m_ptr > 59) || (*s_ptr > 59) )
        {
            cout << " \n WHOA !! Invalid Time !!! " ;
            ask_them_again = 1;
        }
    }
}
int CalcSeconds ( int hr, int min, int sec)
{
    int total_sec;
    total_sec = hr*3600 + …
siddhant3s 1,429 Practically a Posting Shark

>>add system("CLS")
Oh really? Did you see Tux's signature, the last point? It is definitely written for system("PAUSE") but if you ever opened it, you will find that system() commands are evil. Never use them.

So what to do? Nothing. Why would you want that your user terminal should be clear?
We, the Linux User, works much on the Command Prompt(we call it Terminal or Shell). We get really angry if a application clears our console windows.
So please don't clear the screen, your user may not like it. (it is Rude).

To the OP:Please mark this thread as solve, if you have done with your problem.

siddhant3s 1,429 Practically a Posting Shark

Thats because you are mistakenly using an = instead of == in the
while ( ask_them_again =1 )

change it to
while ( ask_them_again ==1 )

siddhant3s 1,429 Practically a Posting Shark

cin >> *h_ptr >> colon >> *m_ptr >> colon >> *s_ptr;
This statement is wrong. Tell your user to separate hours, minutes, second by spaces (Like this : "5 15 30") and remove the colon cin >> *h_ptr >> *m_ptr >> *s_ptr; If you want the user to be able to input time like HH:MM:SS then you will need to take the input in a string and then parse it.

siddhant3s 1,429 Practically a Posting Shark

Hmm, you should have posted the full code in your last post. Anyways, here is your code with the done modification. This must be working:

#include<iostream>
#include<string>
using namespace std;
int main()
{
    int i = 0;
    string studentInfo[7][7];
    char inputDone = 'y';

    for (i=0; inputDone == 'y'; i++)//notice the change here
    {
        cout << "Please Input student's first name : " << endl;
        cin >> studentInfo[i][0];

        cout << "Please Input student's last name : " << endl;
        cin >> studentInfo[i][1];

        cout << "Please Input student's  ID Number : " << endl;
        cin >> studentInfo[i][2];

        cout << "Please Input student's Test 1 Grade : " << endl;
        cin >> studentInfo[i][3];

        cout << "Please Input student's Test 2 Grade : " << endl;
        cin >> studentInfo[i][4];

        cout << "Please Input student's Test 3 Grade : " << endl;
        cin >> studentInfo[i][5];

        cout << "Are there anymore student grades to enter? (y/n)" <<endl;
        cin >> inputDone;
    }//end of loop

}//end of main
siddhant3s 1,429 Practically a Posting Shark
cout << "Are there anymore student grades to enter? (y/n)" <<endl;
{
    
cin >> inputDone;
}

remove the red bracket in your code.

siddhant3s 1,429 Practically a Posting Shark

A new-comer should be directed to Python. It is real and it is fun.
I have never seen a powerful yet easy language like this. One can almost learn the basic in a weekend.
1.Go to http://python.org/
2. Download Python for you platform (most GNU/Linux Distros have it pre-installed)
3. Start reading the official Tutorial http://docs.python.org/tutorial/

siddhant3s 1,429 Practically a Posting Shark

Yes.
OP=Original Poster and on this thread it is you. Congratulations ;)

siddhant3s 1,429 Practically a Posting Shark

Wow, I really like kid playing with men's tools.
So you want to become a cracker?
Good Good.
Didn't your mother told you that cracking isn't sexy?
In my advice, be a hacker. Read : How to become a Hacker

Salem commented: Nice link +32
siddhant3s 1,429 Practically a Posting Shark

All vibration ceases at Zero Kelvin;
All 'things' are made of matter;
All matter is made up of particles that vibrate;
therefore
All 'things' that do not vibrate
either
Do not exist
or
exist at Zero Kelvin.

Wrong!!. You are only considering classical phenomena but quantum mechanics has more to say. At absolute zero kelvin, the motion does not ceases and the maximum velocity of a electron corresponds to the kinetic energy equal to the Fermi Energy.
To quote from the link:

even if we have extracted all possible energy from a metal by cooling it down to near absolute zero temperature (0 kelvins), the electrons in the metal are still moving around; the fastest ones would be moving at a velocity that corresponds to a kinetic energy equal to the Fermi energy. This is the Fermi velocity.

Even the entropy is not zero for non perfectly-crystalline/ solids at zero kelvin. This is called Residual Entropy. Ice, for example has a residual entropy of 3.4J/K/mol.

siddhant3s 1,429 Practically a Posting Shark

short usually 2 bytes, So in your case the 3d array Matrix has size of
2 X 6 X 400 X 400 = 1920000 bytes = 1.83 Mega Bytes.
Don't you think it is much?
If your program is using this much of memory, ask yourself " Do I really need this much"?
And besides, why aren't you using vectors instead of arrays?

#include<iostream>
#include<vector>

int main()
{
    using std::vector;
    const short d1=4,d2=400,d3=400,init_val=0;
    //Define it!!
    vector<vector<vector<short> > > Matrix(d1,
    vector<vector<short> >(d2,
    vector<short>(d3,
    init_val)));

    //Use it!!
    Matrix[0][25][14]=11;
    std::cout<<Matrix[0][25][14];
}

I know the syntax is a bit discouraging. Thats why most people go with some wrapper classes like that of Boost's multi_array
For time being cosider the following article from Dr.Dobb's

At the worst case, follow Tux's suggestion and stick with arrays.

siddhant3s 1,429 Practically a Posting Shark

>And template metaprogramming.
Template metaprogramming is an entirely different concept. It aims at compile-time code execution so as to save the run-time cost. Using template metaprogramming will force the compiler to generate the output of a template metaprogrammed function at the compile-time itself.
For Example of template metaprogramming, this code will generate fabonaci number at the compile-time itself.

template <int N>
struct Factorial 
{
    enum { value = N * Factorial<N - 1>::value };
};
 
template <>
struct Factorial<0> 
{
    enum { value = 1 };
};
 
// Factorial<4>::value == 24
// Factorial<0>::value == 1
void foo()
{
    int x = Factorial<4>::value; // == 24
    int y = Factorial<0>::value; // == 1
}

If you can infer, this will save much run-time costs.
Overloading does not execute any code. It merely means generating different code for a similar interface.

>Uh, no, the compiler knows exactly what code to generate: something that
>looks up a function pointer specified by the object and calls that function.
Yeah, but does it knows which Draw() to call at the compile time? No.
>Uh, no. Code isn't generated at runtime when calling virtual functions.
Yes, the code isn't generated but it is binded dynamically.

If you think you have conquered the world correcting me above, you might need to re-think. The OP would surly confused if I had gone too deep in the explanation.
My above posts highlights the fact that "the compiler doesn't …

siddhant3s 1,429 Practically a Posting Shark

Find your answer by Searching the web: here is a pointer to a good thread which is very near to yours http://groups.google.com/group/comp.lang.c++/browse_thread/thread/1a4b427d09b3eb77

siddhant3s 1,429 Practically a Posting Shark

>I'm pretty sure everybody is an idiot and most of the time most people don't
>know what they're talking about.
I don't think so. Most of the time I know what I am talking about. It is just that very rarely (usually when there is an emotional pressure) I speak rubbish.
>I don't know what I am talking about usually.
Thanks for telling. But could you help us by marking, on your post, whether or not you are serious?
>That has nothing to do with being senior.
Not likely. Programming is greatly influenced by experience. I don't say seniority, but it must be the experience that matters. It is no doubt that Ancient is very experienced than you are.
If only you would have read the pointer he passed, you would have find that in c++, compile time polymorphism is referred to as 'overloading' while the run-time polymorphism is known as "polymorphism".

To the OP: As I pointed above,

Overloading means using the same operation to "invoke different code", you
say, and polymorphism uses the same "piece of code to operate on objects of
different types".

Polymorphism and Overloading are often given a parent-child relationship:"Overloading is a kind of polymorphism"

Static Polymorphism (the compile-time) means basically those language structure which will cause the compiler to produce code at the compile-time. That is, the compiler is well aware that what code is to be generated at the compile-time itself. The …

siddhant3s 1,429 Practically a Posting Shark

Now I have really got mad upon iamthwee. What was the cause of infraction for my post #4. Just because I gave an infraction to him, he gave me an infraction. Isn't it kiddish?
iamthwee, I was not spoon feeding, but you were. It is noway to behave in this forum.
I will surely get to some moderator about your 'spoon feeding' behavior.
One thing is that a man makes a mistake. The second thing that he doesn't realize it. The worst thing is that he don't want to.

You are really having some superiority complex. As you keep showing it with your pathetic coding style. Now who would have been though that a simple procedural problem would have included OOP?

The worst part is that you are featured poster. Does Daniweb has no criteria to give that tittle?

I don't want keep this thread dirty. Any agreement or disagreement from anyone else iamthwee are subjected to the reputation counter of this post. Any further discussion should be directed to my PM box with the reference of this thread.

Thank You

tux4life commented: I agree :) +6
siddhant3s 1,429 Practically a Posting Shark

A little mathematics can do the magic. The sum of consecutive integers from [tex]n_1[/tex]
to [tex]n_2[/tex] (including both [tex]n_1[/tex] and [tex]n_2[/tex])
is given by:

[tex]sum=n_2(n_2+1)-n_1(n_1-1) \over 2[/tex]

(If you need a proof(which is quite trivial), let me know)


Hence the problem now remains to run a nested loop with iterators [tex]n_2[/tex] and [tex]n_1[/tex] such that [tex]1<n_1<n_2<s[/tex] and check if [TEX]sum=s[/TEX]

iamthwee commented: stop the spoon feeding chicken! -4
Salem commented: Seemed like a good answer to me :) +32
siddhant3s 1,429 Practically a Posting Shark

>It serves the same purpose as endl

Not likely. There is a difference between std::endl and \n.
(To the OP: The following explanation may not suited for you. The answer of your question was well given in the posts above)
To understand lets see what happens you do a cout.
When you issue a std::cout statement, the data you passed is stored in the stream buffer and is displayed only when there is appropriate time and space to do so. Displaying the stream buffer on to the standard output is proceeded flushing the buffer stream(that is to empty the stream). Once the data has been sent to the standard output, the stream is automatically flushed. Alternatively, you can force a stream flush by using the .flush() member function.

'\n' is a escape sequence but std::endl is a stream manipulator. When you issue a std::endl, it does two jobs

  • Prints a new line and
  • Forces the stream to standard output and flushes the stream.

Hence, when you use std::endl, you are sure that it would print the result to the output device immediately.

amrith92 commented: Great Info... :) +1
tux4life commented: Right! +6
siddhant3s 1,429 Practically a Posting Shark

First of all let me simplify your code (and remove unnesasarily added inheritence):
So now, have a look at the snippet below

#include<iostream>

template<typename T>
class tc{};//a template class

class Base{};//a base class
class Derived : public Base { void der_fct(); /* ... */ };//a derived class
int main()
{
tc<Base>* ptc;//pointer ptc is pointer to tc<Base>
ptc= new tc<Derived>;//error

Base* pb;//pointer to Base
pb=new Derived;//Okay
}

Hence, you discovered that you can assign the address of a Derived object to pointer to the Base object. But you cannot assing the address of a tc<Derived> object to the pointer to the tc<Base> .
This is perfectly desirable.
Realize that "Derived is a child class of Base but tc<Derived> is not the child class of tc<Base> ."
Repeat the last quoted sentence 10 times.

Hope the above helped.

Similarly, for your code, realize that " Feature<Base> is not a base class for Feature<Derived> although Base is a base class of Derived> "

siddhant3s 1,429 Practically a Posting Shark

>you misread the problem
Yes you are right. Well, here is what I 'thought' the problem was( I don't know if it is relevant here, but I don't feel like leaving the solution posed above orphan )
"Given the location of N customers , find out the location of the store such that all the customers are at a minimum distance R. Minimize R"

Now coming to the problem itself(I reread it). I have not put forward enough time to solve the problem,but the most obvious solution that comes into my mind is of complexity n times m.
I think it could be improved. Will think over it. Anyone with better algorithm? Don't post the algorithm, just its complexity.

siddhant3s 1,429 Practically a Posting Shark

I agree with Hemsworth. C++ is a programming language. You project do not require any programming backbone. You should also use a similar animation suite. If Adobe Flash is not affordable, you might look at Open Flash http://www.osflash.org/
Also, have a look at http://www.openlaszlo.org/

It is not good to use a lift to pick up a feather .

siddhant3s 1,429 Practically a Posting Shark

You should perhaps look laws governing the trajectories. I am not going to derive them here (although proof is trivial from Newtons Equation of Motion) but am listing the paramatarized (wrt time) equations governing projectiles.
[tex]x=v_0\times cos(\theta) \times t\[/tex]
and
[tex]y=(v_{0}\times sin(\theta) \times t) - (\frac{1}{2}\times g\times t^2)[/tex]

where [tex]v_0[/tex] is the initial speed, [tex]\theta[/tex] is the angle of projection from horizontal, [tex]g[/tex] is accelaration due to gravity (nearly [tex]9.8m/s^2[/tex]) and [tex]t[/tex] is time.

siddhant3s 1,429 Practically a Posting Shark

Start with two coordinates. It is trivial that the position of the store in this case would be the mid point of the line joining the two coordinate.
Now start with three coordinates. The most suitable location in this case would be a point from which, all the three points are equidistant. Mathematics tell me that such a point will exist.(There is a name given to the point which equidistant from the three vertices of a triangle. Find out what it is called.)

After you have cracked it for three points, think more about how will you find the solution for four or more points.


I remember, a similar problem was asked to me in some programming competition. :)

siddhant3s 1,429 Practically a Posting Shark

>>Nope, I can compile it using the newest MinGW compiler
Wow! I am fully impressed, I will give you 500 points for this. But, being silent, knowingly that OP is moving toward non-portable code should not be practiced by (a portability fan like) you. The OP should be aware that conio is not part of the Standard C++ Library one should seldom use it.
I cannot say the rest of the code is standard though, but it is okay since at least it is compiling on g++(or any other standard compiler for that matter).

siddhant3s 1,429 Practically a Posting Shark

Shouldn't that be #ifndef MYHEADER_H ?
Yes it should be.

siddhant3s 1,429 Practically a Posting Shark

Tux, you should also tell him to place the conditional compilation preprocesor directive so that his files are not included more than once:

#ifdef MYHEADER_H
#define MYHEADER_H
//content of the files
#endif

This will make sure that this header file will be included only once even if you issue two #include directive.

tux4life commented: Right, I forgot :P +5
siddhant3s 1,429 Practically a Posting Shark

Implementation looks pretty fine. Post the declaration too.
BTW, the declaration should be

class student{
public:
        student();
        ~student();
        //other stuff
}
siddhant3s 1,429 Practically a Posting Shark

I think you should use the CImg Library.

Also note that I found it easily by using a search engine like www.google.com

Always STFW before posting a query.

siddhant3s 1,429 Practically a Posting Shark

Everyone who starts using template eventually get struck on this question.
Read this for decent answer :http://www.parashift.com/c++-faq-lite/templates.html#faq-35.12
If you are still confused (iff only after reading the above link), get back to us. But do read it completely.

siddhant3s 1,429 Practically a Posting Shark

>>All of a sudden, you could find it happens at some much more obvious and
>>inconvenient point in the code (say save file).

Murphy's Law for Computer programming: A program with undefined behavior(or ill defined behavior) will continue to work in all debugging session and will halt when a extremely important transaction is going on (for example a billion dollar deal).

LoL, so true

siddhant3s 1,429 Practically a Posting Shark

As you are, new, I should rather clarify what Narue meant to say.
Look at Line 7. That is the declaration of the function (formally this is called a prototype of a function). It tells the compiler "Hey, if you get a call for this function, assume that I am written it somewhere below" Thus the compiler(actually the linker) will search you whole code to find the definition of the function. The definition tells what the function actually does.
So write the definition of rand_1toN as:

//after the line 30.
int rand_1toN(int sides)
{
//write codes of the function
}

Also, your brackets {} are misplaced, correct them.

siddhant3s 1,429 Practically a Posting Shark

Good. I am glad you could explain me your dynamism correctly. Your question is already been answered by Ancient Dragon in post#14.

Besides, your problem is that whenever your length of the array changes, you need to have to type a new loop, Right? So why not put the whole thing in a bigger loop and do the dynamics.
I have coded the whole thing and generated the correct output.

A sample would help:

for (int i=0;i<N;i++)
/* This loop will track the number of times the plus sign would come*/
    {

        for (int k=0;k<N-i;k++)
 /*Loop to count how many times each of the set of similar length (having same number of plus sign) to be printed*/
        {
           /*write the code to print arr[k] here. your self*/
            for (int j=0;j<i;j++)
/*This loop will add a plus sign and next element.
            {
               /*write code to print a plus sign immediately followed by a[j+k+1] */
            }
            /*write code to print a new line. i.e. '\n' */

        }
    }

Try to figure out what the above code does. And only after giving all up, ask us.

BTW, my output is coming as:

10
20
30
40
50
60
70
10+20
20+30
30+40
40+50
50+60
60+70
10+20+30
20+30+40
30+40+50
40+50+60
50+60+70
10+20+30+40
20+30+40+50
30+40+50+60
40+50+60+70
10+20+30+40+50
20+30+40+50+60
30+40+50+60+70
10+20+30+40+50+60
20+30+40+50+60+70
10+20+30+40+50+60+70
siddhant3s 1,429 Practically a Posting Shark

Can you believe I am so stupid that I don't know the meaning of `dynamic solution', Can you please help me by telling me what exactly you mean by dynamic solution rather than using fancy words?

PS: The code you are using will work for any array length. The only problem is that you will have to initialize the array at( or before) the compile time.

siddhant3s 1,429 Practically a Posting Shark

Not when I posted that post. Anyways, all my remarks remain the same except that you could strip off the Advices for books.

siddhant3s 1,429 Practically a Posting Shark

Your problem is perhaps that you have not planned proper algorithm before writing this code.
Sit down with pencil and paper and plan out out what you want to accomplish. Then analyze it through the eye of an compiler. Try to go through the whole algorithm step by step as if a computer would.

Try-and-error is not correct methodology to learn how to program. Besides, you strongly need to learn C++. Pick up some book. If you don't want to spend money, there is a book "Thinking in C++ by Bruce Eckels" available free on the internet. It is one of the finniest book in this regard. Else, go for Accelerated C++.

siddhant3s 1,429 Practically a Posting Shark

You have put the struct student as a private data member. Private members are not inherited. Use the protected specifier to inherit student in the class B.

I am still not sure what you exactly want to accomplish. Can you show us by writing a function call in the main(). And this time please post your code in the code tags

[code=cpp] //your code goes here

[/code]

siddhant3s 1,429 Practically a Posting Shark

If it helps you, std::string has a function c_str() which will returns a corresponding c-string of the std::string from which it is called.

siddhant3s 1,429 Practically a Posting Shark

>>From a very good programmer who is both fluent in c and c++
It is a sad part that beginners of the language are actually incapable of telling if a programmer is 'good' or 'bad'. A C guru is not necessarily a C++ guru and vice-versa. Perhaps, a major fraction of C++-is-just-another-C gang are the C programmers only. This concept is straight forward incorrect.
Don't rely on some programmer. Trust a written evident. Always ask a programmer to give you reference about what he is saying. ( Good programmers always give references to their knowledge)

siddhant3s 1,429 Practically a Posting Shark

To the OP: Please read Why shouldn't you use an old compiler and What should main() return


>>BTW, your code is in C, though it's valid C++ code the C++ way of I/O is
>>preferred over the I/O from stdio.h
May be not. As you already said the OP is using void as the return value of main; this makes it a invalid C and C++ code.

>>Sorry siddhantes I didn't see your post
I don't mind as long as you spell my name right :)

tux4life commented: How do I spell your name right? +4
siddhant3s 1,429 Practically a Posting Shark

>>but problem is how to make this dynamic??
What do you mean by dynamic?

BTW, do you realize that the code which you have written is no where near to c++?
This is a C code. And you participate in a C++ forum. No doubt you have a red dot on the reputation bar.
C++ is not C. There is a hell lot of difference between these two language.
You should start learning C++. Buy some books like Accelerated C++
and learn the language first.

WaltP commented: Wrong. C IS C++. But C++ is not C -4
tux4life commented: C is C++ with minor exceptions, by the way: siddhant3s, you didn't say something wrong :) +4
siddhant3s 1,429 Practically a Posting Shark

>>I got another question though, is it possible to make the iterator to go through a
>>defined intervall?

find(v.begin(), v.begin()+5,
siddhant3s 1,429 Practically a Posting Shark

>>should I just start with wxWidgets and shut eyes on others
Simply: Yes.
BTW, there is no point in learning different GUI libraries. It is always better to master one. GTK+ runs very smoothly on GNOME environment but it also run on Windows pretty well. But then, wxWidget uses the native libraries so it will be much a better choice.(Considering your wxPython background)
I rest the case.

siddhant3s 1,429 Practically a Posting Shark
siddhant3s 1,429 Practically a Posting Shark

I used GTK+ in my application in C++, It provided me with a greater control over my GUI.
But that control came over the price of a very ugly looking code for a typical C++ programmer. Anyways, I managed to separate the GUI in different modules, So it didn't create problems.
Be sure to use GTK+ with GLADE/libGlade. You can download the latest glade designer. It will output a .glade file. You will need to convert in a xml using a python script.

>>I'm trying wxWidgets right now, I will try GTK+ next then QT. But I don't know
>>anything about how to go about GTK!
Why do you need to learn three GUI libraries? Why not master only one.

siddhant3s 1,429 Practically a Posting Shark

>>find() returns an integer of the position of the substring within the string,

Who told you that? find() is a generic function defined in algorithm. String::find is different from std::find.

siddhant3s 1,429 Practically a Posting Shark

Alternatively,

for ( int i = 0 ; i < v.size(); i++ )
{
   if ( v[i].name == "Misco" )
   {
      cout << "FOUND\n";
      cout << v[i].name << endl;
      cout << v[i].age << endl;
   }
}

What a Bull-!@#$ of code was that. Simply lost all purpose of find()

To the OP: If you want to store only name and age, you might consider a map which is more appropriate.