snoopy11's Profile User Rating: *****

Reputation: 895 Master
Group:
Mentors
Active Posts:
2,623 (1.45 per day)
Joined:
20-March 10
Profile Views:
35,696
Last Active:
User is online 36 minutes ago
Currently:
Viewing Board Index

Previous Fields

Country:
GB
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
Nintendo
Your Car:
Nissan
Dream Kudos:
1100
Expert In:
C/C++
Icon   snoopy11 has not set their status

Posts I've Made

  1. In Topic: Setting up GLFW in Visual Studio 2013 correctly?

    Posted 27 Feb 2015

    No,

    This is the correct forum,

    Have you tried linking to opengl32.lib before GLFW ??

    in linker input ?

    These errors seem to correspond to that library

    Snoopy.
  2. In Topic: unknown type name 'PGconn' in C

    Posted 27 Feb 2015

    Well,

    I would read this first

    http://www.postgresq...ibpq-build.html

    but have you made a mistake and your include should really be

    #include "postgresql/libpq-fe.h"

    and not
    <>

    ??

    Snoopy.
  3. In Topic: Is there anything wrong with my C code struct?

    Posted 27 Feb 2015

    Well a few things

    your declaration of struct node,

    all structs end in a ;

    so it should be

    struct node
    {
        int value;
        struct node *next;
    };
    
    


    Then in your insert function

    you must implicitly declare node as being a struct like this

    void insert(struct node *pointer, int value)
    {
        struct node *start = pointer;
        /* Iterate through the list till we encounter the last node.*/
        while(pointer->next!=start)
        {
            pointer = pointer -> next;
        }
        /* Allocate memory for the new node and put value in it.*/
        pointer->next = malloc(sizeof(struct node));
        pointer = pointer->next;
        pointer->value = value;
        pointer->next = start;
    }
    
    


    also since this is C you dont have to cast malloc,

    in fact you shouldn't cast malloc.


    Or you could use a typedef like so and that would also be legal.

    typedef struct node node;
    
    struct node
    {
        int value;
        struct node *next;
    };
    
    
    void insert(node *pointer, int value)
    {
        node *start = pointer;
        /* Iterate through the list till we encounter the last node.*/
        while(pointer->next!=start)
        {
            pointer = pointer -> next;
        }
        /* Allocate memory for the new node and put value in it.*/
        pointer->next = malloc(sizeof(node));
        pointer = pointer->next;
        pointer->value = value;
        pointer->next = start;
    }
    
    


    So to answer your question yes, you did a few things wrong.

    Regards

    Snoopy.
  4. In Topic: Printing without Printf Statements?

    Posted 26 Feb 2015

    no...

    line 48 printf("\n");


    should be moved into the bottom loop

    } // end inner loop

    printf("\n");

    }/// end outer loop

    so you start a new line every width

    and line 36 should be removed

    Snoopy.
  5. In Topic: Printing without Printf Statements?

    Posted 26 Feb 2015

    Yes so you have 4 lines you don't need so your outer loop goes from 0 to height-4 j++ etc

    header

    main pattern

    header

    ie

    header(width)

    for loops for main pattern

    end loops

    header(width)

My Information

Member Title:
Engineering ● Software
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
6
Programming Languages:
C/C++, Java, Python, J2ME, Android, Liberty Basic, Basic.
learning VB.net and C#

Contact Information

E-mail:
Private

Comments

  • (2 Pages)
  • +
  • 1
  • 2
  1. Photo

    da1 Icon

    16 Jun 2014 - 22:25
    can you help me not sure what this other guy is telling me
  2. Photo

    David W Icon

    15 Jun 2014 - 04:54
    Hey snoop's ... good to see you're still breathing :)
    Shalom my friend ... and best regards David
  3. Photo

    tarmizi_adam2005 Icon

    27 Nov 2013 - 18:59
    Just wanted to stop by and say thanks for giving some nice advice in my post (reading wave file c/c++) the other day. Thank you so much snoopy11 !
  4. Photo

    yowzz28 Icon

    07 Oct 2013 - 23:44
    hello sir can you please help me to my project in turbo c++ IDE We will do a simple payroll system just a simple only sir . Please help me :((
  5. Photo

    ankush.dev2 Icon

    02 Aug 2013 - 11:27
    sir what can i do to enhance my knowledge of c/c++ programming..??
    i am the one you helped me last day regarding that audio library proect...
  6. Photo

    cpp_help Icon

    31 Jul 2013 - 20:18
    Hello Snoopy11. I often use this site to learn more about c++ and I have seen many of your comments in helping other people. You seem quite knowledgeable in c++. I needed some help. Can you email me at dx6007@wayne.edu please. I would really appreciate it. Thanks.
  7. Photo

    lana ana Icon

    29 Apr 2013 - 00:25
    https://www.facebook.com/lena.ana.904
    this is my page on fb ,, please if u can help me
  8. Photo

    lana ana Icon

    29 Apr 2013 - 00:24
    hello ... i am lana from jordan can u help me in problem please i must send it to my Dr today please i need ur help ,,, ??
    my problem about multithread
  9. Photo

    mamelove25 Icon

    19 Feb 2013 - 11:02
    Hello My Dear, My Name is Mame. i saw your profile today and became interested in you,i will also like to know you more,and if you can send an email to my email address,i will give you my pictures here is my email address (mame25live@yahoo.co.uk) I believe we can move from here! Am waiting for your mail to my email address above because i have much to tell you,
    love Miss Mame.
  10. Photo

    raghav.naganathan Icon

    16 Nov 2012 - 02:21
    Dude...before your rep(343) changes, I would like to tell you that it is a perfect cube :)
  11. Photo

    SaranyaNair Icon

    02 Oct 2012 - 22:51
    hi snoopy..i'm new to programming,,can u guide me some step how to more explore in programming?
  12. Photo

    Joshuwa Icon

    07 Jun 2012 - 17:42
    I am new to programming and I really want to learn. What would you suggest learning first? Whats the best approach?
  13. Photo

    Joshuwa Icon

    07 Jun 2012 - 17:42
    I am new to programming and I really want to learn. What would you suggest learning first? Whats the best approach?
  14. Photo

    v0rtex Icon

    05 Jun 2012 - 15:01
    Your win32 tutorials are really good! Just thought I'd say thanks.
  15. Photo

    David W Icon

    05 Jun 2012 - 11:23
    Win 32 eh ? Very cool ... well maybe some day :)
  • (2 Pages)
  • +
  • 1
  • 2