Results 1 to 5 of 5

Thread: do you want help in C++ ?

  1. #1
    Praneet's Avatar

    ZeroPaid Regular

    Join Date
    Sep 2010
    Location
    India
    Posts
    14

    do you want help in C++ ?

    Hi!
    If someone want help about C++. I would like to help.

  2. #2
    Drew Wilson's Avatar

    AKA IceCube

    Join Date
    Dec 2007
    Location
    Igloo Country?
    Posts
    9,663
    If I ever learn Javascript, then PHP, C++ might be the next language I'd consider learning. Unfortunately, I'm very time poor half the time and teaching myself stuff like this sometimes just doesn't happen even though I see the value in knowing these kinds of languages. :frown:

  3. #3
    Praneet's Avatar

    ZeroPaid Regular

    Join Date
    Sep 2010
    Location
    India
    Posts
    14
    I can teach some basics.
    but It is OOPs (object oriented programing) more than C language here self created functions can be created.
    It also supports a constructed data type (structure).
    and in C++, union allows the overlay of more than one variable in the same memory area. normally, each and every variable is stored in a separate location and as a result, each one of these variable have their own addresses. often it is found that the variable used in the program, appear only in small portion of source code, in short it helps to reduce data size of variables.
    well Class also a good helpful user defined data type.
    So advance level is also desirable to learn.

  4. #4
    carpefile's Avatar

    Chronic

    Join Date
    Aug 2003
    Location
    Omnipresent
    Posts
    1,414
    You want a challenge, then you should pick up the development of OFF
    http://en.wikipedia.org/wiki/OFFSystem
    Nobody can start over and make a new beginning, but anyone can start today and make a new ending.

  5. #5

    Zeropaid Noob

    Join Date
    Sep 2010
    Posts
    1

    yes would like help in C++

    doing a address book, and unsure the path to take. - needs to have name (first, middle, last), address, city, state, ... all input, person search by name func., print func., and write to file (notepad would be perfered). I was thinking a switch for choice to enter address, or print, or search.. and maybe a array for handle the user input.(?) Thinking this is best.. needs to have separate classes, implement.cpp files. (inherited classes). I have a start on the program, but not sure how to go about it. Not understanding arrays well. ANY help would be great and highly appreciated.
    addressType implement.cpp file

    #include "addressType.h"
    #include "personType.h"
    #include <iostream>
    #include <string>
    using namespace std;

    void addressType::setAddress(string streetAdd, string cityAdd, string stateAdd, string zipAdd)
    {
    setStreet(streetAdd);
    setCity(cityAdd);
    setState(stateAdd);
    setZip(zipAdd);

    }
    void addressType::setStreet(string streetAdd)
    {
    cout << "\nEnter the street: ";
    cin >> StreetAdd;
    street = streetAdd;
    }
    void addressType::setCity(string cityAdd)
    {
    city = cityAdd;
    }
    void addressType::setState(string stateAdd)
    {
    state = stateAdd;
    }
    void addressType::setZip(string zipAdd)
    {
    zip = zipAdd;
    }
    void addressType::getAddress(string& streetAdd, string& cityAdd, string& stateAdd, string& zipAdd)
    {
    streetAdd = street;
    cityAdd = city;
    stateAdd = state;
    zipAdd = zip;
    }
    string addressType::getStreet()const
    {
    return street;
    }
    string addressType::getCity()const
    {
    return city;
    }
    string addressType::getState()const
    {
    return street;
    }
    string addressType::getZip()const
    {
    return zip;
    }
    void addressType::printAddress()const
    {
    cout <<"The street entered is : " << street ;//<< "" << cityAdd << "" << stateAdd << "" << zipAdd << endl;
    }
    addressType::addressType(string streetAdd,string ctyAdd, string stateAdd, string zipAdd)
    {
    street = streetAdd;
    city = streetAdd;
    state = stateAdd;
    zip = zipAdd;
    }
    calling int main
    #include <fstream>
    #include <iostream>
    #include <string>
    #include "personType.h"
    #include "addressType.h"
    using namespace std;

    int main()
    {
    int test = 0;

    string fname, mname, lname, street;
    fname = "";
    mname = "";
    lname = "";
    street = "";

    // myFile.open("MyTxT.txt");
    ofstream myFile;
    personType personObj;
    addressType addObj;

    cout << "Welcome to your address book.\n" << endl;

    cout << "make a selection:" ;
    cin >> test;
    switch(test)
    {
    case 1:
    personObj.setFirst(fname);
    personObj.setMiddle(mname);
    personObj.setLast(lname);
    break;
    case 2:

    addObj.setStreet(street);

    break;
    default:
    cout << "BAILING ....\n";
    }
    personObj.printName();
    //addObj.printAddress();

    myFile.close();
    system("pause");
    return 0;
    };

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •