So to sump up and close the whole issue, null pointer is used for implying that the pointer itself isn't pointing to anything, pointing to nowhere in the memory location!, and null character in...
Type: Posts; User: Romyo2
So to sump up and close the whole issue, null pointer is used for implying that the pointer itself isn't pointing to anything, pointing to nowhere in the memory location!, and null character in...
A question that I believe you can fully assist me on,
int main()
{
char *p="Moved the glass to the other side";
while (*p != NULL)
{
printf("%s\n", p);
p++;
OMG...very efficient and effective explanation!!
I understand the whole issue, thank you very much!
Finally :wink::wink:
Also when I write a function that returning pointers, sometimes I see programmers writing
return NULL in the end of the function, what that means so?
What I know about NULL that its role stands to intisialize a pointer that I declared without 'dereferencing' to any other bytes in the memory, and its value is always 0.
the case for me that I'm...
If you're used to explain and gloss things in one direction, the NULL is still not comprehended for me, can you please explain deeply it and how it related to pointers? I have listened for laser but...
VERY VERY perfect, honestly helped me very much!
generally in C programming I can't write like this
int main()
{
int* p=15;
p=10;
printf("%d", p);
To make it simply for why I'm thinking like that...
What I've read about pointers and maybe it's wrong!! .. that
int *p means p is an int pointer, and *p is the value that p has!, so when I...
I want to print the value 10.
Alright got you! so it's not my code writing problem, it's run time error! so what I have stated from the beginning about :
int main()
{
int *p=15;
p=10;
printf("%d", *p);
...
the bug was because the syntax writing that I declared previously isn't acceptable to my compiler..! (it's a bit different in Visual c++ 2010).
Regarding to your example, why do I need those whole...
when I write *p instead of p in the printf code, the code gets stuck while compiling..!
also lets say I have wrote
*p=10 instead the previous code's row...it's still the same case.
so how can...
So if the matter is just about needing a null pointer constant, then I can do like this and all things must be worked properly:
int *p=NULL;
p=10; // now the p is considered as a null constant...
To the first note, why shouldn't I? I can tell u that I understood you, but truly didn't!, and I attended to this website for learning/helping.
I don't want to count on others, but I really still...
So if I'm not wrong, and from what you're telling about, I can do like this thing of coding:
int *p=10;
p=15;
printf("%d", p);
then it must print 15 without any errors, ye?
I conclude if an pointer has been initialised to be a null pointer, its value(value of the null pointer) can't be changed because the null pointer is constant and has always the value 0/<null> ,...
I'm with you!
then why when I write this syntax writing as :
int *p;
p=NULL;
in my compiler(Visual C++ 2010) shows the same result as
*p=NULL ?
Also it's showing an error while writing
Got you, so what I've posted in comment #2 is completely correct, right?
NULL can be used either as a value or a pointer.
Also, is the
NULL can be used sometimes as a pointer and sometimes as a value?
well, I have some touch question and I really need help, good explanation needed for answering them.
1)Can anyone explain exactly what do
int *p=10 &&
int *p=NULL stand for? and isn't
NULL...
Hi, what's wrong with this code? I just followed the requirements of using strcat.
#include<stdio.h>
#include<string.h>
int main()
{
char arr2[]="I love mom";
char arr3[]="45";
...
Alright, so I'm sorry for posing C++ code pattern over here, and what about the question that I asked it over post #4, any assistance?
ty.
Alright as far as C++ and C programming are approximately the same so no problem :)
what do you mean with this sentence "Remember the * is not part of the variable name, it's part of the type...
I've made a struct with two different variable names, and I want to connect those two different struct with eachother, so I've done a code that's logically applying what I have wanted, here it's:
...
Really? is there a different between
int *multiply(int a, int b); and
int (*multiply)(int a, int b);? it's the same pattern of writing but the braces is different in those two cases!