| | |
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 |
#include adobe ansi api array asterisks binarysearch changingto char character cm copyimagefile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic execv feet fgets file fork forloop frequency function getlasterror givemetehcodez global grade graphics gtkgcurlcompiling hacking hardware highest histogram i/o include incrementoperators infiniteloop input interest kernel keyboard kilometer license linked linkedlist linux linuxsegmentationfault list locate logical_drives looping loopinsideloop. lowest match matrix meter microsoft motherboard mqqueue mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming radix recursion recv repetition research reversing scanf segmentationfault sequential shape socket socketprograming standard string systemcall threads turboc unix user voidmain() wab windows.h windowsapi






