Bench's Profile User Rating: *****

Reputation: 938 Master
Group:
Expert
Active Posts:
2,462 (0.78 per day)
Joined:
20-August 07
Profile Views:
24,541
Last Active:
User is offline Today, 11:16 AM
Currently:
Offline

Previous Fields

Country:
GB
OS Preference:
Who Cares
Favorite Browser:
Who Cares
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Who Cares
Your Car:
Who Cares
Dream Kudos:
200
Expert In:
C/C++

Latest Visitors

Icon   Bench has not set their status

Posts I've Made

  1. In Topic: How do you learn things which are not googleable?

    Posted 28 Apr 2016

    View PostSkyAdrenalin, on 28 April 2016 - 03:35 PM, said:

    hi i want to ask can somebody help me with algorithms they told me that if i don't know algorithims i can't be a programmer...

    Who told you that? Complex algorithms are usually written by mathematicians or scientists rather than programmers.
  2. In Topic: Complex declaration of pointers

    Posted 24 Apr 2016

    There's a fairly detailed explanation about how to grok those declarations here: http://www.codeproje...-C-declarations
  3. In Topic: pointer of a pointer; Storing values

    Posted 23 Apr 2016

    Note - it would be better to copy+paste the code you've tried into [code] tags instead of taking a screenshot and posting the image.


    View PostReehgeaux, on 23 April 2016 - 11:10 AM, said:

    My goal is to get words from a csv file ignoring white space characters using the least amount of memory using Pointers and P-Pointers. My code is as shown in the attachment and it works but the catch is that I'm not sure if I "really" store each value to the pointer of a pointer.
    What do you mean by "really" store each value? Your program appears to be simply storing char values in an array. a simple char* would be enough really.

    As a suggestion, it would be a good idea to use more meaningful variable names which describe their purpose. CNT and CNT2 are not at all descriptive; in fact they're just confusing - it makes your program very difficult to read and understand when you use meaningless variable names.

    The logic is over-complicated for what you're actually doing however. I don't think your program is really a very good use-case or example for the usage of a pointer-to-pointer, because you just don't need any extra indirection, and you're not really making any real use of it.


    View PostReehgeaux, on 23 April 2016 - 11:10 AM, said:

    I'm quite new to pointers so I'd be glad to hear constructive criticisms, suggestions and corrections. An explanation of what a pointer to pointer is will really help me too. Cheers!!

    A pointer-to anything is still 'just' a pointer (i.e. a memory address value). Don't get too hung up on what it "might" be pointing to (i.e. what you might find when you dereference it at runtime).

    If you can understand the concept of a pointer, then a pointer-to-pointer is really just the same thing - when your program is running, a pointer in memory is a pointer in memory.

    The concept of "pointer-to-pointer" is just part of the C language's static typing system, but it's all the same thing at runtime - your computer has no concept of a pointer-to-pointer; that bit of information doesn't exist outside of your program's source code.

    Your compiler throws away all the type information from the compiled binary, so whether its a "pointer-to-pointer" or "pointer-to" something else is completely irrelevant, your computer doesn't know the difference.

    I'd suggest spending some time reading through some pointer tutorials, and try to get comfortable with the mechanics of pointers. There are some good articles here:
    http://www.augustcou...torial/ptr.html
    http://www.eternally...t_pointers.aspx
    http://c-faq.com/ptrs/index.html
    http://cslibrary.stanford.edu/104/
  4. In Topic: Getting started with <regex>

    Posted 22 Apr 2016

    Maybe a shorter and simpler solution - foo.
  5. In Topic: Pointer Help

    Posted 22 Apr 2016

    View Post~Aryan, on 22 April 2016 - 07:39 PM, said:

    How can I have an object that is stored in a StudentWorld object get a pointer to the object its stored in?
    Circular dependencies/circular references are usually a really bad idea because they can cause all kinds of problems, and they're usually a symptom of a more fundamental problem in your design.

    I'd urge you to think really carefully about this - what exactly are you trying to do with your Actor which requires it to know about its 'owner'? (i.e. why does it need to know or care anything about the StudentWorld).

    Consider what other design choices you might be able to make instead - It sounds like some of the logic you've written in Actor doesn't really belong to that class; that logic may potentially belong to StudentWorld, or maybe it could make more sense in a separate class. Anything you can do to avoid the need to have circular references/circular dependencies in your program is likely to result in a better design.

My Information

Member Title:
D.I.C Lover
Age:
33 years old
Birthday:
August 15, 1982
Gender:
Location:
UK
Years Programming:
13
Programming Languages:
C, C++, C#

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Comments

Page 1 of 1
  1. Photo

    Sy-Coderz Icon

    23 Jun 2012 - 09:47
    Hi,
    bro please add me at : [email protected]
    add me please i need some help
    i wait u
  2. Photo

    OLH064 Icon

    28 Aug 2011 - 11:09
    That is the best signature ever.
  3. Photo

    Jeff H Icon

    19 Jun 2011 - 00:54
    Hey Bench,
    I have dual monitors and was looking over at the other one as I was trying to give you a + rep and accidently hit the - rep.
    Just let me know what I need to do to help get it changed. I already left a reply in the thread.
  4. Photo

    Jeff H Icon

    19 Jun 2011 - 00:54
    Hey Bench,
    I have dual monitors and was looking over at the other one as I was trying to give you a + rep and accidently hit the - rep.
    Just let me know what I need to do to help get it changed. I already left a reply in the thread.
  5. Photo

    sleepybug Icon

    20 Feb 2010 - 06:45
    hey bench!!thanks for the simple code concerning node,pointer and linked list ,you posted..now after learning pointers i understand your that program much more clearly and its simple working..thanks for help buddy.
  6. Photo

    neptunusmaris Icon

    16 Feb 2010 - 10:56
    Thanks
  7. Photo

    CodingDesire Icon

    16 Feb 2010 - 09:21
    Hello there, thank you very much for your help!
Page 1 of 1