It might be me being stup because I use VC++. But I don't think you can include windows.h in Dev-C++. But again, I never use Dev-C++.
(I btw didn't look at the rest of your code)
My Program:I'm using Dev-C++ and am constantly getting errors, I'm not sure why though..Code:/* *** COMPILING WITH DEV C++ 4.9.9.2 *** */ #include <windows.h> #include <iostream> #include <stdio.h> #include <stdlib.h> #include <conio.h> using namespace std; int main(int argc, char *argv[]) { if (GetAsyncKeyState(VK_LSHIFT)&1) { do { int a; string array [42] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","0","1","2","3","4","5","6","7","8","9", " ", " ","?","!","#","*" }; { Sleep(45); for(int i=0; i<27; i++) { a = rand()%42; cout << "\n " << array[a]; cout << " "; } cout << endl; } getch(); return 0; } else (GetAsyncKeyState(VK_RSHIFT)&1) { do { int b; string array [1] = {"WRONG CHOICE..."}; { Sleep(45); for(int i=0; i<27; i++) { b = rand()%1; cout << "\n " << array[b]; cout << " "; } cout << endl; } getch(); return 0; } } } }
The purpose of this program is if int a is called, it shows the random integers, and it will look like the matrix (that's when the LShift is pressed) and when the RShift is pressed, it's supposed to show the else choice.
Thanks to all who can help me
-Money001
It might be me being stup because I use VC++. But I don't think you can include windows.h in Dev-C++. But again, I never use Dev-C++.
(I btw didn't look at the rest of your code)
Using a string array when a char array would suffice... and C-style includes.
what are the actual errors you get?
"I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov
It'd help to see the errors. lol
put the code into there, and look at the errors yourself, It's not super hard =/....
Main problem i can see is the do while statement. Wheres the while at ?
Take a look at this The do-while Statement (C++)
"I don't believe in an afterlife, so I don't have to spend my whole life fearing hell, or fearing heaven even more. For whatever the tortures of hell, I think the boredom of heaven would be even worse." - Isaac Asimov
If you want help you should post the errors. We are not people who get paid to answer questions, so don't ever ask us to compile to get the errors. It is very rude. If you don't post the info needed we simply won't help you.
I don't mean to be harsh, and don't think that I don't like you because that is not the case. This is a very helpful C++ community, and I wanted to advise you on how to get an answer for your question.
Thanks in advance.
I think the guy is trying to be ironic.
Replying to hes own posts, /haha.
Post the Compiler Errors
Also, if i were you, I would get visual C++ 2008 express. It's free, and it is better. When I tried Dev, i got many errors not regarding code, but something with the .o files or something like that.
Last edited by Auxilium; 06-09-2011 at 09:03 AM.
Everyone who even thinks he 'knows' Cpp should have seen this even without errors & whutnot:
Code:} else (GetAsyncKeyState(VK_RSHIFT)&1) // this should either be else if or just another if statement. What you're doing now makes no sense.
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger