921 Posted Topics
Re: There wouldent be smilies if you had used code tags .. :icon_wink: And stop complaining, I personally would really like to have programming lessons at school, and I wouldent leave something like this to the last minute. | |
Re: Are you sure that if you just start a new Win32 application and add '#include<windows.h>' to the start of it that it wont find it ? | |
Re: also, it might help to have: [CODE] myfile.open ("lover_names.txt", ios::ate | ios::app); [/CODE] So it automaticly seeks the end of the file before you begin writing to it. | |
Re: This will draw a temporary rectangle on the console: [CODE] #define _WIN32_WINNT 0x0500 #include<windows.h> #include<iostream> int main() { HWND console = GetConsoleWindow(); HDC dc = GetDC(console); Rectangle(dc, 50, 50, 100, 100); ReleaseDC(console, dc); std::cin.ignore(); return 0; } [/CODE] | |
Re: [CODE] //Login #include <iostream> #include <string> #include <conio.h> using namespace std; int main() { cout << "\tWelcome to Login\n"; int security = 0; do { string username; cout << "\nUsername: "; cin >> username; string password; cout << "Password: "; cin >> password; if (username == "echoestroy" && password == … | |
Re: Here is an exmaple to help you. [CODE] #include<iostream> using namespace std; int main() { char str[] = "one two three four five"; bool wasSpace = 1; for (int i = 0; str[i]; i++) { if (wasSpace) str[i] &= str[i] >= 'a' && str[i] <= 'z' ? 223 : 0; … | |
Re: Mabey this function I made will help you: [CODE] template<class t> inline char *toBase(t val, int base) { char d = 1; t c; if(val>=0)for(c=base;c<=val;c*=base,d++); else for(c=-base;c>=val;c*=base,d++); char *bin=new char[d+1]; register char i=d; for(val*=base;i;i--) bin[i-1]=48+(val/=base,(char) ((val%base)<0?-(val%base):(val%base))); bin[d]='\0'; return bin; } [/CODE] You can use it do convert any number to … | |
Re: What exactly do you need us to check? -Something must be going wrong because I get 34 errors trying to compile this | |
Re: I would help you If you provided abit more info on what your trying to do. | |
Re: I learned windows programming off that tutorial, its very good :) | |
Re: uhm, not exactly sure, but mabey the itoa function automaticly allocates the appropriate memory? | |
Re: This code with print all the characters from any file to the console. [CODE] #include<iostream> #include<fstream> using namespace std; const char fileName[] = "FILENAME"; int main() { ifstream in(fileName, ios::in | ios::binary); while (in) { cout << (char) in.get(); } system("pause"); return 0; } [/CODE] | |
Re: This should work for a left click: [CODE] mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); [/CODE] | |
Re: It acts as an if-else statement for example: [CODE] a = b < 10 ? true : false; [/CODE] is the same as.. [CODE] if (b < 10) { a = true; } else { b = false; }[/CODE] | |
Re: Here is a commented code that does the same as the image. :) [CODE] //Assignment 8: Pointers, Functions, and Input Validation //By: Curtis Davenport #include <iostream> #include <cstdlib> using namespace std; bool isValid(char *name) { if (strlen(name) > 100) return false; for (int i = 0; name[i]; i++) { if … | |
Re: Make a 2D array. char fname[100][50]; fname[0] = "First Name1"; fname[1] = "First Name2"; ... and so on | |
Hi I have a memory leak somewhere in this code but I have no idea where. Can anybody help me out ? [CODE] #include <windows.h> #include <mmsystem.h> #pragma comment(lib, "winmm.lib") #include <fstream> #include <time.h> #include <cstring> #include "resource.h" using namespace std; const char cn[] = "SameGame"; // ClassName HBITMAP BLUEBMP … | |
Re: is this what your looking for ? [CODE] #include <iostream> #include <windows.h> using namespace std; const char heart = 3, diamond = 4, club = 5, spade = 6; int main() { cout << heart; Sleep(1000); system("cls"); // Clears the console cout << diamond; Sleep(1000); system("cls"); cout << club; Sleep(1000); … | |
Re: [ICODE] int positionen = 0; positionen = textBox1->SelectionStart; this->textBox1->Select(0, 5); this->textBox1->SelectionColor = Color::Blue; this->textBox1->DeselectAll(); this->textBox1->SelectionStart = positionen; this->textBox1->SelectionColor = Color::Black; [/ICODE] Hope it helps =] | |
The End.