Pages

Aug 9, 2011

Clean up the Screen in C/C++ Using CLS

How to Clean up the Screen in C/C++



How to Clean up the Screen in C/C++

To clean up your C/C++ screen you can use system("cls"). It is very understandable that some compilers does not support cls/CLS and clrscr()



/* | Author     : Alim Ul Karim               |
   | Email      : auk.junk@live.com           |
   | Portfolio  : auk-port.webs.com           |
   | Blog       : bit.ly/auk-blog             |
   |------------------------------------------|
   | Code tested on CodeBlocks , GCC Compiler |
   | Example of cls or clean up screen        |
   |------------------------------------------|
 */


#include <stdio.h>

int main(){
    printf("Before system(cls)\n");
    system("cls");
    printf("after system(cls)\n");
}

Author Alim Ul Karim's Related Links:
Related Links :
SEO LABELS:

Clean Screen In C/C++ , 

CLS in C/C++ ,  

system("cls") in C , s

ystem("cls") in C++, Cl

eanScreen in c, 

clean the screen in C/C++

Send Data Using Flash

Alim Ul Karim's Blog: Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - S...: "Adobe Flash CS3,CS4,CS5 (ActionScript 3.0 AS3) - Send Data (SendData) to a URL or PHP or ASP Page as Post or Get Method Example by using th..."



Alim Ul Karim's Blog: Send Data Using Flash AS3

Aug 8, 2011

Convert double to char[] array in C/C++

Convert double to char[] in C/C++

How to Convert Double to Char[] Array in C/C++



How to Convert Double to Char[] Array in C/C++


It is very easy to convert double to char[] array in C or C++, we can do it by using sprintf method.
If you have no idea about sprintf , then please take a look at sprintf in cplusplus.com .

In below code , we are trying to utilize the the sprintf to get the double to get back in the char[] array in C or C++:


/* | Author     : Alim Ul Karim               |
   | Email      : auk.junk@live.com           |
   | Portfolio  : auk-port.webs.com           |
   | Blog       : bit.ly/auk-blog             |
   |------------------------------------------|
   | Code tested on CodeBlocks , GCC Compiler |
   | Example of Double to Char[] array        |
   |------------------------------------------|
 */


#include <stdio.h>

int main(){
    char c[10]; //becuase double is 8 bytes in GCC compiler but take 10 for safety 
    double d = -234.2341;

    sprintf(c , "%lf" , d);
    printf("output :: |%s|\n" , c);
}

How to Convert Double to Char[] array in C/C++
It is not very hard to convert double to char[] array in c or C++ , we can do it by using sprintf method.

How to convert Double to char[] array using sprintf in C/C++


Related Links:


Search Labels:

Double to Char[] array,

Convert Double to Char[] array, 

Convert Double to Char[] array in C

Convert Double to Char[] array in C++ ,

Convert

double

to

char[]