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

Reputation: 287 Architect
Group:
Author w/DIC++
Active Posts:
1,463 (0.73 per day)
Joined:
16-May 09
Profile Views:
33,479
Last Active:
User is offline Yesterday, 02:45 PM
Currently:
Offline

Previous Fields

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

Latest Visitors

Icon   Anarion loves music more than ever :)

Posts I've Made

  1. In Topic: Need help with c++ example

    Posted 21 Nov 2014

    Lets think about your variables and the logic of the loop in your program: first, you initialized max and min to 0. Then inside the loop, you take the user input and assign it to x, and right after it, you compare this value with max and min with the initial value of 0. So, the first iteration of your loop is doing something wrong, don't you think so?
    Think of how you would do the same task in your mind and compare it with what you are doing in the loop.
  2. In Topic: Need help with c++ example

    Posted 21 Nov 2014

    Please show us what you have done so far so that we can help you with the problem :)
  3. In Topic: Structure help

    Posted 21 Nov 2014

    View Postmegagig, on 21 November 2014 - 04:01 AM, said:

    Since I have east, west, north and south and each have 4 quarters, wouldn't I need 4 arrays? This assignment is really stumping me

    The point of using an array is exactly to eliminate this. You will have one array, which is basically the same 4 doubles you had before. But by using an array, you gather these 4 variables with different names under one single name.
  4. In Topic: Structure help

    Posted 20 Nov 2014

    View Postmegagig, on 21 November 2014 - 02:30 AM, said:

    Thanks guys, I'll be working on this more tomorrow. I may try to setup an array again if I can.

    Don't forget, an array paves the way for a loop, which enables you to do repetitive tasks much easier. Consider this:
    int a1=1, a2=2, a3=3, a4=4;
    

    Now lets assume you need to increment these 4 variables each by 1. How do you do this?
    One way would be:
    a1 += 1;
    a2 += 1;
    a3 += 1;
    a4 += 1;
    

    Which is inelegant. Whenever you see that you are copying code like this, know that you could do better and avoid this inelegant repetition.
    A much better approach would be:
    int a[] = {1, 2, 3, 4}; //an array of 4 integers, enables iteration by using an index
    for(int i=0; i<4; ++i) {
       a[i] += 1; //each time, updates a single integer, based on the index
    }
    
  5. In Topic: Structure help

    Posted 20 Nov 2014

    Also, your constructs really miss loops. You could greatly improve the design by using loops and arrays, as mentioned by jimblumberg.

My Information

Member Title:
The Persian Coder
Age:
22 years old
Birthday:
May 17, 1992
Gender:
Interests:
Music Production, Tennis, Programming, KitKat, Cars, Bikes
Full Name:
Kian Nezhadfard
Years Programming:
~4
Programming Languages:
Good At: C++, Linux

Contact Information

E-mail:
Private
Twitter:
http://twitter.com/anarion1191

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