| | |
Need Help understanding Pointer
![]() |
•
•
Join Date: Jul 2007
Posts: 5
Reputation:
Solved Threads: 0
Hi all,
I am trying to point a pointer to another pointer and just failed to get resultm here's my failed code,
I am getting single space printed out instead of "This is Three"
Am I doing wrong, how should I point ptr to point[3]????
Any Help will be appreciated
Rgds,
Will
I am trying to point a pointer to another pointer and just failed to get resultm here's my failed code,
C Syntax (Toggle Plain Text)
char *point[] { "This is One" "This is Two" "This is Three" }; char *ptr; ptr = point[2]; printf("%s\n", ptr);
Am I doing wrong, how should I point ptr to point[3]????
Any Help will be appreciated
Rgds,
Will
Last edited by Ancient Dragon; Feb 10th, 2009 at 8:42 am. Reason: add code tags
•
•
Join Date: Jul 2007
Posts: 5
Reputation:
Solved Threads: 0
I got it worked i mised ',' in *point declaration
But Now compiler is making warning but working absolutly correct
Warning is "warning: assignment discards qualifiers from pointer target type"
Am I still wrong?? or warning is just warning not error
Rgds
Will
C Syntax (Toggle Plain Text)
char *point[] { "This is One", "This is Two", "This is Three", };
But Now compiler is making warning but working absolutly correct
Warning is "warning: assignment discards qualifiers from pointer target type"
Am I still wrong?? or warning is just warning not error
Rgds
Will
Last edited by gemni7; Feb 10th, 2009 at 6:51 am.
![]() |
Similar Threads
- this pointer (C++)
- problem with understanding buffers (Assembly)
- Help with pointer syntax... (C)
- question in return string (C)
- understanding file system (C++)
- Is My Understanding of C++ OO features correct? (C++)
- Help! C program w/Pointer Notation to Convert Text (C)
- Null Pointer (C++)
- pointer (C)
Other Threads in the C Forum
- Previous Thread: Individual Sector Reading in C
- Next Thread: Prgramming in C
| Thread Tools | Search this Thread |
adobe api array arrays binarysearch calculate char cm convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic feet fflush file floatingpointvalidation fork forloop frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators intmain() iso kernel kilometer km linked linkedlist linux linuxsegmentationfault list locate logical_drives loopinsideloop. match matrix microsoft motherboard mqqueue mysql oddnumber odf open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer posix power probleminc program programming pyramidusingturboccodes read recursion recv recvblocked repetition research scanf scheduling segmentationfault send shape socketprograming socketprogramming stack standard strchr string suggestions systemcall test unix urboc user variable voidmain() wab win32api windows.h






