Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:45:45+00:00 2026-05-29T10:45:45+00:00

I have a function where I’m passing in an iterator to a char *

  • 0

I have a function where I’m passing in an iterator to a char * buffer (which is also a char *). The function needs to increment the iterator. Anyway, I found that a good method of passsing the iterator into the function is by passing the pointer by reference:

bool myFunction(unsigned char * &iter)
{
   ...

However, I’ve heard that this is bad form and could cause problems. Here is the method that my coworker suggested I use:

typedef unsigned char * unsignedcharptr;
bool myFunction(unsignedcharptr &iter)
{
   ...

It looks to me like they’re both doing the same thing. Is there a compiler difference between these two methods (I’m using Visual Studio 2005)? Which is correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:45:45+00:00Added an answer on May 29, 2026 at 10:45 am

    I don’t think there’s any difference between the two. You should ask your coworker why he believes there is.

    What might be the cause is for maintainability, where if you wanted to switch from unsigned char * to char * you’d only have to change one place. But this, I think, could lead to other problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have function in C that reads byte by byte from a given buffer
I have function: char *zap(char *ar) { char pie[100] = INSERT INTO test (nazwa,
I have function getCartItems in cart.js and I want to call that function in
So I have function that formats a date to coerce to given enum DateType{CURRENT,
In my Java code I have function that gets file from the client in
I have a function that gives me the following warning: [DCC Warning] filename.pas(6939): W1035
I have a function that gets x(a value) and xs(a list) and removes all
I have function which takes in an parameter of a class called Triple, and
This is driving me crazy: I have function void gst_init(int *argc, char **argv[]); in
I created a class: class A: aList = [] now I have function that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.