Tuesday, July 3, 2012

Can you read a space with scanf? - C GNU/Win

If you are a student, and you are learning C, your teacher would have thought you that scanf can't read spaces as it treats spaces as line breakers. But It's not actually like that. See,

#include<stdio.h>
void main(void)
 {
  char line[32];
  printf("Enter a Text with Space :");
  scanf("%s",line);
  printf("\n\nReceived Text : %s",line);
 }

New Color Print for C/C++ DOS/Unix

No need of cprintf(...), no need of textmode(), textcolor(), textbackground().. Just print it as a string usin formatted character (%s). I'll give you examples.

Example Code :

Getting A Line Without Echoing - java.io.Console

Here's a code that can show how to receive a String or a Char[] without echoing

ConIO Extended features for GNU-C

Some of Extended ConIO features for GNU-C. Download it from here..!

Instructions: