| | |
Need Help understanding Pointer
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
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 |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming spoonfeeding stack standard strchr string strings structures suggestions system systemcall test testautomation unix user voidmain() wab win32api windows.h






