| | |
i am a to c programing..and a doubt about pointers
![]() |
•
•
Join Date: Nov 2005
Posts: 5
Reputation:
Solved Threads: 0
hi guys ,
I am a first year student!
can anyone help ..
the code. is .
main()
{
char *b="abc";
printf("%s",b);
}
the output is :abc.
my doubt is :
how can we assign a string constant to a pointer.And when we assign like this is a character array with the name b[] is initialised to "abc"?
and can anyone expalin this program:
#include<stdio.h>
main()
{
char *j="abc";
printf("%u\n%u\n","abc",&"abc");
printf("%u\n%u",j[1],j[0]);
}
and the out put was :
415
419
98
97
please help...
I am a first year student!
can anyone help ..
the code. is .
main()
{
char *b="abc";
printf("%s",b);
}
the output is :abc.
my doubt is :
how can we assign a string constant to a pointer.And when we assign like this is a character array with the name b[] is initialised to "abc"?
and can anyone expalin this program:
#include<stdio.h>
main()
{
char *j="abc";
printf("%u\n%u\n","abc",&"abc");
printf("%u\n%u",j[1],j[0]);
}
and the out put was :
415
419
98
97
please help...
•
•
•
•
Originally Posted by arun_kumar_c
my doubt is :
how can we assign a string constant to a pointer.And when we assign like this is a character array with the name b[] is initialised to "abc"?
•
•
•
•
Originally Posted by arun_kumar_c
and can anyone expalin this program:
the out put was :
415
419
98
97
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
I should have given you the reason for that also...you can see that here
http://www.gidnetwork.com/b-56.html
http://www.gidnetwork.com/b-56.html
![]() |
Similar Threads
- Advertising Your Site for Free (Promotion and Marketing Plans)
Other Threads in the C Forum
- Previous Thread: Converting without additional headers
- Next Thread: Counting occurrence of numbers in C
| Thread Tools | Search this Thread |
* ansi api array arrays binarysearch calculate centimeter changingto char character convert copyanyfile copypdffile creafecopyofanytypeoffileinc createcopyoffile createprocess() directory dynamic execv fflush file floatingpointvalidation fork forloop frequency function getlasterror getlogicaldrivestrin givemetehcodez grade graphics gtkgcurlcompiling gtkwinlinux hardware highest histogram homework i/o inches include infiniteloop input interest intmain() iso keyboard km license linked linkedlist linux list looping loopinsideloop. lowest matrix microsoft mysql oddnumber open opendocumentformat openwebfoundation pdf pointer posix power program programming pyramidusingturboccodes radix read recursion recv recvblocked repetition reversing scanf scheduling segmentationfault send shape single socketprogramming stack standard strchr string suggestions test threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windows.h windowsapi






