Hi all, I was trying to make a program which counts number of chars in a string using concpt of pointers. Following is the code:
#include
#include
void main()
{
char *ptr1;
int ctr=0;
clrscr();
printf("Enter the string");
gets(ptr1);
while(1)
{
if(*ptr1!='/O')
{ *++ptr1; // *ptr1++;
ctr++;}
if(*ptr1 =' ')
{
break;}
}
printf("Total chars are %d",ctr+1);
getch();
}
Above program compiles w/o errors but gives 2 warnings :
Line 14: Constant out of range in comparison.
Line 18: Possibly incorrect assignment.
I think I code it perfectly and I fail to interpret these warnings.
Note: If I execute the program ignoring the warning then once I pass the string the system comes to an halt and to come out I have to press ctrl+Pause break.
Pls help me to fix the error.....
Thanks
Stuck with preg_replace
Hi,I'm trying to use preg_replace to remove part of the IP address submitted using a form on my website. The full IP is entered into my SQL database, but when printing it on the website I want to
2 decima places & How to reload my page
Hello There,How do i put full-stop (.) after second figure from behind? ie if i have 123456 in my database and i want it to echo as 1234.56Secondly, am designing a shopping website. I want the pages
help connecting a form to php and then emailing the form
Ok. So, I made a form, and I need help to where when submitted, I get an email with the submitted details. I have attached all the files you might need. The email should look like the 'Email.html'
help retrieiving results and doing pagination
Having some trouble trying to get the results to show on more than just one page. What is happening is that when i input a subject or zip code, i get results and links on the bottom to show the number
Uploading Filetypes and placing them in seperate folders.
Hello, first post , and asking for help im afraid. Very new to PHP, was making good progress I thought , but im stuck with this part. I have a uploading form that works perfectly and uploads
LIMIT $start, 10... how to pass last value queried into next page with GET??
Ok I know how to display the first or last 10 results of a query...$result = mysql_query("SELECT * FROM messages ORDER BY timemsg DESC LIMIT 10");In a perfect world all the rows ID's would
Help please - How to validate from 2 possible answers
Hi I hope somebody can help me with what will probably be really simple, I'm pulling my hair trying to get my head round it.I've got a contact form and I would like to add to it a couple of simple
Undefined variable when using $_SERVER['PHP_SELF']
Hi guyz, please suggest me something...On first.php I have one input field NAME, and on posting the form it moves to "second.php" showing the entered value of input field using $_POST,
PHP Cannot redeclare class
I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot redeclare class" error.** edit **I know its these 2 files, because when i comment out the
PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.Thanks!