Anarion's Profile User Rating: -----

Reputation: 342 Architect
Group:
Author w/DIC++
Active Posts:
1,600 (0.7 per day)
Joined:
16-May 09
Profile Views:
37,651
Last Active:
User is offline Today, 01:02 PM
Currently:
Offline

Previous Fields

Country:
IR
OS Preference:
Linux
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Playstation
Your Car:
Who Cares
Dream Kudos:
1150

Latest Visitors

Icon   Anarion has not set their status

Posts I've Made

  1. In Topic: I'm new to coding

    Posted 30 Jul 2015

    If you really want to get good at C++, then online tutorials only can help you just a little (not to mention if you don't choose them wisely, they can damage your learning process by teaching you outdated, bad practices). I suggest Programming: Principles and Practice Using C++ by Bjarne Stroustrup (the creator of C++). Although there are other very good books as well. As long as it's an updated and standard-compliant book written by a respected author, you are good to go! ;)
  2. In Topic: Write the encoded string to a second file, such as coded.txt

    Posted 29 Jul 2015

    You haven't stated what the problem is. However, I noticed your loop:
    while (inputFile) //While last read operation successful, continue
    {
        cout << input << endl; //Display last read line
        getline(inputFile, input);//Read next line
        for (size_t i = 0; i < input.size(); ++i)
        {
            input[i] += 4;//Adding 4 to the ASII value each character
        }
    }
    

    cout << input << endl doesn't do what you think in the first iteration because you still have not read anything from the file. So, you are just outputting an empty string for the first round.

    Remember that you can use getline as a condition. So, the loop can be changed to the following:
    while( getline(inputFile, input) ) //While last read operation successful, continue
    {
        //now, you are sure that this part is executed only if the getline operation has succeeded
        cout << input << endl;
        //and the rest of the code
    }
    
  3. In Topic: How to define a vector with variables and arrange in 3x3x3 grid

    Posted 29 Jul 2015

    To be honest, not sure if I have understood you correctly.

    You have a struct which contains the 3 values(i.e. x y z). How about having a vector of this struct:
    struct myStruct; //the struct definition goes here
    std::vector<myStruct> someVector; //now each element is a struct which has 3 float/double values
    


    Edit: After reading Xupicor's post above, I'm guessing what I thought is way off. Feel free to ignore my post if that's the case. What happened here, stays here :whistling:
  4. In Topic: Using nested looping(C++ programming) to display a number pattern

    Posted 29 Jul 2015

    Using pow is too much overkill for this task. Also, this is C++ so printf should not be used.
    To illustrate what's going on, let's take a look at an example:
    #include <iostream>
    
    using namespace std;
    
    
    int main() {
        
        for(int i=0; i<4; ++i) {
            cout<<"i = "<<i<<endl;
            for(int j=0; j<4; ++j) {
                cout<<"\tj = "<<j<<endl;
            }
        }
        
        return 0;
    }
    

    Can you guess how the output is going to be shown before compiling? If yes, then modifying it to achieve your desired output is easy. Remember that you can output on the go, there is no need to store the values in 4 variables, you can just print them on screen in each iteration.
  5. In Topic: Dunno facing what problem

    Posted 28 Jul 2015

    Again, you forgot to post the code. Unless you provide the code you are having problems with, no one can help you.

My Information

Member Title:
The Persian Coder
Age:
23 years old
Birthday:
May 17, 1992
Gender:
Interests:
Music, Tennis, Programming, KitKat, Cars, Bikes
Full Name:
Kian Nezhadfard
Years Programming:
7
Programming Languages:
C++, PHP, R, JavaScript, HTML, CSS

Contact Information

E-mail:
Private

Comments

Page 1 of 1
  1. Photo

    Hybrid SyntaX Icon

    10 Feb 2014 - 14:02
    sup?
  2. Photo

    estherNamogo Icon

    03 Nov 2013 - 06:33
    Hello
    Nice to meet you write
    me at (esther2namogo@hotmail.com) i will send you my picture OK.
  3. Photo

    jatinjindalj Icon

    06 Sep 2012 - 09:01
    Hey Regarding your code snippet at
    http://www.dreamincode.net/code/snippet4621.htm-->
    Can you please explain:
    why when at line 37 and 38,If I do
    while(q!= NULL) {//Line 37
    q = q->link;
    }
    t = new node;
    t->data = str;
    t->link = NULL;<...
  4. Photo

    Anarion Icon

    07 Aug 2012 - 06:23
    Thanks! I had made it for DIC Signature Contest and put it on my sig since then.
  5. Photo

    AnalyticLunatic Icon

    06 Aug 2012 - 09:05
    Just wanted to drop by and say Sweet Sig. Sometime I need to make one for myself.
  6. Photo

    David W Icon

    07 Jun 2012 - 00:31
    Shalom shalom my Regal Persian Coder Friend
  7. Photo

    Anarion Icon

    16 Mar 2011 - 00:56
    @abrsefid: ba arze sharmandegi, komaki az man sakhte nist. Az beine portha faghat ba USB kar kardam oon ham dar sathe kheili payin. Be shoma pishnahad mikonam baraye javabe soaletun dar internet jostejoo konid :)
  8. Photo

    yogesh201010 Icon

    05 Mar 2011 - 18:41
    hi i am yogesh
    how to connect internet by mob in linux.
    and tell me book for linux learning
    thanks
  9. Photo

    abrsefid Icon

    27 Feb 2011 - 05:23
    salam man donbale 1 code c++ (ubuntu) migardam vase send o receive data ba port serial mishe rahnamaeem konid ?
  10. Photo

    hamishehiran Icon

    10 Aug 2010 - 23:02
    thanks for add! ;) nice to meet you!
  11. Photo

    Anarion Icon

    28 Mar 2010 - 08:27
    Thanks! Happy new year to you too :)
  12. Photo

    saSBH2 Icon

    28 Mar 2010 - 07:03
    Happy New Year :)
Page 1 of 1