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

  • SEARCH
  • Home
  • 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 7905781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:36:00+00:00 2026-06-03T10:36:00+00:00

My code fragment contains (36 and 37 are line numbers): 36 char* colon_unit =

  • 0

My code fragment contains (36 and 37 are line numbers):

36     char* colon_unit = extract_colon_unit( zPath, path, &p_index);
37     if (colon_unit == NULL)

During compilation, I get a warning:

a.c:36: warning: initialization makes pointer from integer without a cast

When I remove the pointer,

char colon_unit = extract_colon_unit( zPath, path, &p_index );

it shows:

a.c:37: warning: comparison between pointer and integer

How can I fix it?

  • 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-06-03T10:36:03+00:00Added an answer on June 3, 2026 at 10:36 am

    This means that the function extract_colo_unit() is returning a character (char) and not a character pointer (char*). When you change the data type of colon_unit to char then you won’t get the first error as now the variable and the value assigned, both have the same type.

    But when you compare the colon_unit to NULL then you are comparing a character, that is, colon_unit to a pointer. That is, NULL is defined as (void*)0, so you get the second error on line 37.

    The solution totally depends on your logic and what it means to return NULL from this function. But if it’s an error case or a case when there is no valid value, it simply returns 0 instead of NULL and compares against 0 in line 37.

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

Sidebar

Related Questions

We have the following code fragment: char tab[2][3] = {'1', '2', '\0', '3', '4',
I have this code fragment class bst { public node root=null; bst() { root=null;
When I run only the code fragment int *t; std::cout << sizeof(char) << std::endl;
I have to following code fragment, and no matter what I set the font-size
Consider the following code fragment in VS2010 Beta 1: let array = Array2D.zeroCreate 1000
Consider the following code fragment: let t1 = async { return process1() } let
For the following code fragment. /*This program demonstartes how a virtual table pointer *
In a code fragment like the following ... class Foo { internal Foo() {
I have a simple code fragment in JS working with prototype inheritance. function object(o)
In this code fragment, which constructor is actually called? Vector v = getVector(); Vector

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.