If you are on windows:
#include <windows.h>
int main(void) {
HWND stealth;
AllocConsole();
stealth=FindWindowA("ConsoleWindowClass",NULL);
Type: Posts; User: epboyd
If you are on windows:
#include <windows.h>
int main(void) {
HWND stealth;
AllocConsole();
stealth=FindWindowA("ConsoleWindowClass",NULL);
Or ShellExecute();
http://code.google.com/android/
One problem I see is in your input; fgets takes in the newline character you enter at the end. I deal with this by doing :
szbuf[strlen(szbuf) - 1] = 0; //Nullfies newline
You don't have to be such a dick.
I was in the exact scenario as you about two weeks ago, and what I ended up doing was :
In Java :
create a new batch file
write the c program name
write the parameters you want to pass to the...
I like doing it this way:
#define forever while(1)
forever {
printf("loop\n");
}
http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628
You can get the PDF at: /* removed */
I pulled this of MS's website:
#include <windows.h>
void NewLine(void);
void ScrollScreenBuffer(HANDLE, INT);
HANDLE hStdout, hStdin;
Never mind, I got it:
char *get_suit (int val)
{
int suit;
static char *suits[] = {"spades", "diamonds", "clubs", "hearts", "wtf"};
if (val < 13) {
I would like to have something like this in my blackjack program :
string suit(int cardvalue) {
if (cardvalue<13)
return "Spades";
else if (cardvalue < 26)
return...
That's what I meant by it could be better.
There is a better way of doing this (read,write) but here is the code I used when making that program:
#include <stdio.h>
#include <stdlib.h>
unsigned char byte;
int main(void) {
#include <stdio.h>
int main(void) {
char string[255];
printf("Enter a string : ");
fgets(string, 255, stdin);
printf("\nYou have entered %d characters",strlen(string));
...