Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: getchar() ? Pin
Kuniva1-Nov-04 8:03
Kuniva1-Nov-04 8:03 
AnswerRe: getchar() ? Pin
Andrew Peace31-Oct-04 3:29
Andrew Peace31-Oct-04 3:29 
GeneralRe: getchar() ? Pin
Kuniva31-Oct-04 5:22
Kuniva31-Oct-04 5:22 
GeneralNVM Pin
Kuniva31-Oct-04 5:28
Kuniva31-Oct-04 5:28 
GeneralCreating A New Font Pin
Leyu29-Oct-04 9:29
Leyu29-Oct-04 9:29 
QuestionHow to get untransparent area (RECT) of icon? Pin
dido2k29-Oct-04 8:38
dido2k29-Oct-04 8:38 
GeneralBITMAPINFO &amp;bmInfo = *(LPBITMAPINFO)hDIB Variable Declarations for bmInfo!!! Pin
lewislewis_lewis29-Oct-04 7:02
lewislewis_lewis29-Oct-04 7:02 
GeneralRe: BITMAPINFO &bmInfo = *(LPBITMAPINFO)hDIB Variable Declarations for bmInfo!!! Pin
dido2k29-Oct-04 8:33
dido2k29-Oct-04 8:33 
GeneralMFC Date option Pin
missnazar29-Oct-04 6:10
missnazar29-Oct-04 6:10 
GeneralRe: MFC Date option Pin
BlackDice29-Oct-04 6:19
BlackDice29-Oct-04 6:19 
GeneralMFC type of file Pin
missnazar29-Oct-04 6:05
missnazar29-Oct-04 6:05 
GeneralRe: MFC type of file Pin
John M. Drescher29-Oct-04 6:06
John M. Drescher29-Oct-04 6:06 
GeneralRe: MFC type of file Pin
missnazar29-Oct-04 6:21
missnazar29-Oct-04 6:21 
GeneralRe: MFC type of file Pin
Maximilien29-Oct-04 7:38
Maximilien29-Oct-04 7:38 

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.