Thread: Newbie Question1

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Question Newbie Question1

    Ok Guy's,
    I am needing to know what functions do the following:

    • Give me a block of memory
    • Tells me a character is not a space (‘ ‘)

    Also, if anyone could direct me to a website that list's all available functions and their purpose I would greatly appreciate it.

    Thanks...

  2. #2
    Banned
    Join Date
    Dec 2008
    Location
    Maputo, Mozambique
    Posts
    82
    Give you a block of memory? calloc() and malloc() (stdlib.h)
    Tells you when a character is not a space? isalnum() (ctype.h)
    Also you could simply say !isspace() (ctype.h)

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Cool

    Quote Originally Posted by c++0x View Post
    Give you a block of memory? calloc() and malloc() (stdlib.h)
    Tells you when a character is not a space? isalnum() (ctype.h)
    Also you could simply say !isspace() (ctype.h)
    Awesome! Thank you!

  4. #4
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Question

    Quote Originally Posted by c++0x View Post
    Tells you when a character is not a space? isalnum() (ctype.h)
    Also you could simply say !isspace() (ctype.h)
    Hey C,

    The isalnum() and isspace() are showing as C++ functions not C. Are they the C functions as well or is there a function for the C language as well?

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Yes, they're there, in the ctype.h (a C header file).
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Dec 2008
    Posts
    25

    Cool

    Quote Originally Posted by Salem View Post
    Yes, they're there, in the ctype.h (a C header file).
    Thank you Salem!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. newbie: array question :(
    By cstudent in forum C Programming
    Replies: 2
    Last Post: 04-09-2008, 06:46 AM
  2. Newbie in problem with looping
    By nrain in forum C Programming
    Replies: 6
    Last Post: 11-05-2005, 12:53 PM
  3. Newbie Programmer
    By Extropian in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 01:17 PM
  4. Some help for a newbie?
    By Ilmater in forum C++ Programming
    Replies: 23
    Last Post: 04-19-2004, 07:44 PM
  5. Newbie Game Develpoers Unite!
    By Telenosis in forum Game Programming
    Replies: 10
    Last Post: 06-22-2002, 02:02 PM