473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

why is there a warning in this code while we perform addition of NULL to an int ?

int a=9;
a=a+NULL;
printf("%d\n",a);

pointer5.c: In function 'main':
pointer5.c:5:2: warning: assignment makes integer from pointer without a cast [enabled by default]
a=a+NULL;
^
Jun 29 '15 #1
2 1220
computerfox
276 100+
Null isn't an integer. If you want to set a default it should be 0 not null.
Jun 29 '15 #2
donbock
2,426 Expert 2GB
What do you want that line to do?
Jun 29 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Jenski182 | last post by:
Is this from a good coder? or a rubbish one? Whichever way, it was paid for his services, just want to know if its worth while.... Thanks Jen x #include <iostream.h> #include <conio.h>
7
by: Douglas Buchanan | last post by:
I cannot access certain column values of a list box using code. I have a list box 'lstPrv' populated by the query below. SELECT tblPrv.fkPrvID, lkpCat.CatNm, lkpSrv.SrvNm, lkpCat.pkCatID,...
3
by: Bas Wassink | last post by:
Hello there, I'm having trouble understanding a warning produced by 'splint', a code-checker. The warning produced is: keywords.c: (in function keyw_get_string) keywords.c:60:31: Released...
16
by: Sunil Varma | last post by:
Hello, Please see the following code. int main () { double da = 0.01, db; db = foo (da); } double foo (double a)
6
by: doncee | last post by:
This is the set up: is a date field on a form. Its control source is the field "date_entered" in"Table1". If there is a date showing in the date_entered field (Text6) & the status in Combo box2...
3
by: Abubakar | last post by:
Hi, I created 2 functions which run in seperate threads. what they do simply is that thread1 starts and does something while the thread 2 waits for it. Then after thread1 is done, it resumes the...
5
by: Jeff | last post by:
ASP.NET 2.0 This code crashes. It generate this error: Value cannot be null. Parameter name: type I've created some custom web.config settings and this crash is related to accessing theme...
30
by: Bill Reid | last post by:
#define MAX_VALUES 64 typedef struct { unsigned value_1; double value_2; double value_3; double value_4; } VALUES; typedef struct {
3
by: Koliber (js) | last post by:
I feel i still do not understand maybe a bit a dispose pattern So I have a question - is this code right? Is fs.Close() there where it is right? If I do understand it in place 'BBB' there can be a...
3
by: frj1001 | last post by:
Hi i am new to c sharp. i am building a simple calculator with a text box and few buttons. i need to store values entered into the text box from string to char array so that i can check for the '+'...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.