Click here to Skip to main content
15,922,145 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Crystal Reports -- Creating s new report at runtime. Pin
Michael P Butler30-Oct-04 0:19
Michael P Butler30-Oct-04 0:19 
QuestionCan I change the Language Resource DLL? Pin
Graham Holdaway29-Oct-04 17:47
Graham Holdaway29-Oct-04 17:47 
GeneralKnowing the path is not like wlaking on it!!! Pin
Ahmad Suliman29-Oct-04 17:27
Ahmad Suliman29-Oct-04 17:27 
GeneralMCI_WAVE_STATUS_LEVEL Pin
Member 94650129-Oct-04 15:27
Member 94650129-Oct-04 15:27 
GeneralUSB with Visual C++... Pin
herbert_chow29-Oct-04 12:55
herbert_chow29-Oct-04 12:55 
GeneralRe: USB with Visual C++... Pin
Andrew Walker29-Oct-04 19:14
Andrew Walker29-Oct-04 19:14 
GeneralRe: USB with Visual C++... Pin
ThatsAlok29-Oct-04 20:27
ThatsAlok29-Oct-04 20:27 
GeneralRe: USB with Visual C++... Pin
herbert_chow30-Oct-04 0:06
herbert_chow30-Oct-04 0:06 
GeneralMemory Leak Pin
BeerFizz29-Oct-04 12:48
BeerFizz29-Oct-04 12:48 
GeneralRe: Memory Leak Pin
Yulianto.29-Oct-04 18:08
Yulianto.29-Oct-04 18:08 
GeneralRe: Memory Leak Pin
ThatsAlok29-Oct-04 20:13
ThatsAlok29-Oct-04 20:13 
GeneralRe: Memory Leak Pin
BeerFizz30-Oct-04 3:59
BeerFizz30-Oct-04 3:59 
GeneralRe: Memory Leak Pin
BeerFizz30-Oct-04 4:45
BeerFizz30-Oct-04 4:45 
GeneralRe: Memory Leak Pin
Sujan Christo29-Oct-04 21:35
Sujan Christo29-Oct-04 21:35 
GeneralFullscreen frame windows Pin
Jörgen Sigvardsson29-Oct-04 11:36
Jörgen Sigvardsson29-Oct-04 11:36 
GeneralRe: Fullscreen frame windows Pin
ThatsAlok29-Oct-04 18:55
ThatsAlok29-Oct-04 18:55 
GeneralRe: Fullscreen frame windows Pin
Jörgen Sigvardsson29-Oct-04 23:04
Jörgen Sigvardsson29-Oct-04 23:04 
GeneralRe: Fullscreen frame windows Pin
ThatsAlok29-Oct-04 23:09
ThatsAlok29-Oct-04 23:09 
GeneralRe: Fullscreen frame windows Pin
peterchen30-Oct-04 2:06
peterchen30-Oct-04 2:06 
GeneralIE web browswer bug Pin
Jim Crafton29-Oct-04 10:54
Jim Crafton29-Oct-04 10:54 
GeneralRe: IE web browswer bug Pin
Jim Crafton29-Oct-04 11:38
Jim Crafton29-Oct-04 11:38 
Questiongetchar() ? Pin
Kuniva29-Oct-04 9:42
Kuniva29-Oct-04 9:42 
Can someone please explain to me why, when u exceed 20 characters input, it doesnt stop but just keeps on accepting input, and somehow ends up passing through the loop a few times instantaneously?
I mean.. just try typing in some 60 characters or so to see what i mean:

#include <stdio.h>

int IsPalindrome(const char*);

int main(void)
{
char str[21]={NULL};
int i=0;
  char c=NULL;

do
{
 if(str[0]!=NULL)
 {
  if(IsPalindrome(str))
   printf("This is a palindrome!\n");
  else
   printf("This isn't a palindrome.\n");
 }
 i = 0;
 while((c=getchar())!='\n' && i<21)
 {
  if((c>='a' && c<='z') || c=='$')
  {
   str[i] = c;
   i++;
  }
 }
 str[i] = NULL;
} while(str[0]!='$');

return 0;
}

int IsPalindrome(const char* str)
{
int len=0, i=0;
// Get string length
while(str[len++]!=NULL) {}
len--;

for(i=0;i<len;i++)
{
 if(str[i]!=str[(len-1)-i])
  return 0;
}
     
return 1;
}


Kuniva
--------------------------------------------
AnswerRe: getchar() ? Pin
David Crow29-Oct-04 10:50
David Crow29-Oct-04 10:50 
GeneralRe: getchar() ? Pin
Kuniva31-Oct-04 5:17
Kuniva31-Oct-04 5:17 
GeneralRe: getchar() ? Pin
David Crow1-Nov-04 2:12
David Crow1-Nov-04 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.