Results 1 to 8 of 8
  1. #1

    Default need help sa C++


    hi guys...bag-o lang ko nagkat-on ug C++. ok ra pagsugod ky naa mn koy background sa C pero pag-abot nkog pointers ug functions ky nagka-saag2 nko... pwede ngau ug tabang ninyo bahin aning butanga?? matsalams!!

  2. #2

    Default Re: need help sa C++

    Pointers are simply pointers to a specified memory address... Example:

    int *ptr; // declare an int pointer
    int y = 10; // set y initially to 10

    ptr = &y; // set the pointer to point to the address (&) of the memory location of y
    *ptr = 15; // set the value of the pointed memory (*) to 15.

    printf("%d", y); // displays 15.


    Pointers are my favorites.

    Here are some advantages of using pointers.

    1. Can act like returning many values from a function

    int i = 1, j = 2, k = 3;
    int ret = foo(&i, &j, &k);
    // after this line, i is now 10, j = 11, k = 12. and ret = 1

    int foo(int *x, int *y, int *z) {
    *x = 10;
    *y = 11;
    *z = 12;
    return 1;
    }


    2. Linked list and dynamic memory allocation
    3. Faster.

    I prefer using pointers than using array.

  3. #3

    Default Re: need help sa C++

    Huh? Pointers ug Functions? Murag kuwang rajd kag tuon brader. Dli mana sa C++ ra ang pointers ug functions. Naa pd na sa C. Hell, halos tanan tingai language naay functions.

    Basa lng brader. Use Google for your questions. If you get stuck on something specific. Ask here. I'll gladly help. As of now, your question is _very_ broad, makes little sense and you didn't even try to search for answers yourself. A simple Google search on pointers brought me these links.

    Have passion for what you do. Programming is a science and like all sciences you have to have a real interest in learning to master it.

  4. #4

    Default Re: need help sa C++

    Quote Originally Posted by robstaman View Post
    hi guys...bag-o lang ko nagkat-on ug C++. ok ra pagsugod ky naa mn koy background sa C pero pag-abot nkog pointers ug functions ky nagka-saag2 nko... pwede ngau ug tabang ninyo bahin aning butanga?? matsalams!!
    sakto c kamahak, ang pointers kay dli na cya C++, sa C na cya so if naa kay background sa C dapat kabalo na ka ana, mao jd na ang isa sa foundation sa C ang pointers and ofcourse functions.

  5. #5

    Default Re: need help sa C++

    Quote Originally Posted by robstaman View Post
    hi guys...bag-o lang ko nagkat-on ug C++. ok ra pagsugod ky naa mn koy background sa C pero pag-abot nkog pointers ug functions ky nagka-saag2 nko... pwede ngau ug tabang ninyo bahin aning butanga?? matsalams!!
    naa man sad pointers sa C bro...wa pa d.i nakasuway ug pointers sa C? Pointers and references are essentials in C/C++ where most of the magic takes place...

  6. #6

    Default Re: need help sa C++

    waaaaaaaaah!! nakalimot jud kog pangutana ni pareng google tungod sa akong kalibog gahapon...

  7. #7

    Default Re: need help sa C++

    mao jud bro. pointers ug functions, naa mana both sa C and C++. even if when you said "pointers ug functions" you meant function pointers, still, naa pod na sila both sa C and C++.

  8. #8

    Default Re: need help sa C++

    Quote Originally Posted by robstaman View Post
    waaaaaaaaah!! nakalimot jud kog pangutana ni pareng google tungod sa akong kalibog gahapon...
    ok rana..

  9.    Advertisement

Similar Threads

 
  1. need help sa linux be version 9
    By kermesh in forum Computer Hardware
    Replies: 3
    Last Post: 03-01-2013, 03:10 PM
  2. Guys need help sa business na carwash
    By mack0y in forum Business, Finance & Economics Discussions
    Replies: 7
    Last Post: 01-29-2013, 12:41 AM
  3. internet cafe business, need help sa specs?
    By jaytol23 in forum Networking & Internet
    Replies: 19
    Last Post: 04-22-2012, 12:38 AM
  4. need help...sa akong mobo sound card
    By Fern in forum Computer Hardware
    Replies: 18
    Last Post: 06-19-2007, 04:30 AM
  5. need help sa C
    By chokobo in forum Programming
    Replies: 12
    Last Post: 02-25-2006, 08:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top