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 5847209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:41:10+00:00 2026-05-22T12:41:10+00:00

Program : void DibLaplacian8Direct(CDib sourceImg) { register int i,j; int w = sourceImg.GetWidth(); int

  • 0

Program:

void DibLaplacian8Direct(CDib sourceImg)
{   
    register int i,j;
    int w = sourceImg.GetWidth();
    int h = sourceImg.GetHeight();
    CDib cpyImage = sourceImg;
    BYTE** pSourceImg = sourceImg.GetPtr();
    BYTE** pCpyImage = cpyImage.GetPtr();
    float G;
    for(j =1;j<h-1;j++)
    {
        for(i =1;i<w-1;i++)
        {
            G = -1*pCpyImage[j-1][i-1] + -1*pCpyImage[j-1][i] + (-1)*pCpyImage[j-1][i+1]+
                (-1)*pCpyImage[j][i-1] + 8*pCpyImage[j][i]    + (-1)*pCpyImage[j][i+1]+
                -1*pCpyImage[j+1][i-1]  + (-1)*pCpyImage[j+1][i] + -1*pCpyImage[j+1][i+1];
            pSourceImg[j][i] = (BYTE)G;
        }
    }
}

warning error:

warning.. Can’t coonvert from int to float..

Warning 1 warning C4819: The file contains a character that cannot be represented in the current code page (1257). Save the file in Unicode format to prevent data loss D:\2nd\imagetool\dibfilter.cpp 1 1 ImageTool

I do’t understand that why its making me warning of int to float.
and for warning 1,
I am using VS 2010.. i do’t know that i am getting warning in StdAfx.h include file .
Amy one can help me with this .

  • 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-22T12:41:11+00:00Added an answer on May 22, 2026 at 12:41 pm

    The first warning is due to the fact that a float has only six significant figures whereas an int can have more. If it does, then accuracy is lost.

    In general, you cannot convert an integer to floating point without possible losing data. Also, you cannot convert from floating point back to integer without losing the deceimal places, so you get a warning again.

    A simple minimalistic code example of the above case:

    #include<iostream>
    using namespace std;
    
    int main()
    {
        int a=10;
        int b=3;
    
        float c;
        c=a/b;
    
        cout << c << endl;
        return 0;
    }
    

    If you are sure of the data being in the range and there wont be any loss of accuracy you can use typecasting to get rid of the warning.

    G = (float) (.....)
    

    Check this for the second warning.

    To get rid of the second warning you need to save the file in Unicode format.

    Go to file->advanced save options and under that select the new encoding you want to save it as. UTF-8 or UNICODE codepage 1200 are the settings you want.

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

Sidebar

Related Questions

My Program overrides public void paint(Graphics g, int x, int y); in order to
class Program { static void Main(string[] args) { String value = Two; Type enumType
Take the following useless program: class Program { static void Main(string[] args) { IUnityContainer
In C#, I can do this: class Program { static void Main(string[] args) {
Here is a quick test program: public static void main( String[] args ) {
Can someone please explain why this program outputs 0x00000004? class AndAssignment { static void
Here is a little test program: #include <iostream> class Test { public: static void
Program followed by output. Someone please explain to me why 10,000,000 milliseconds from Jan
Most program languages have some kind of exception handling; some languages have return codes,
My program generates relatively simple PDF documents on request, but I'm having trouble with

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.