921 Posted Topics

Member Avatar for anifreak

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.

Member Avatar for William Hemsworth
0
131
Member Avatar for winky

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 ?

Member Avatar for Ancient Dragon
0
135
Member Avatar for Black Magic

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.

Member Avatar for Black Magic
0
84
Member Avatar for 3pid

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]

Member Avatar for William Hemsworth
0
236
Member Avatar for echoestroy

[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 == …

Member Avatar for echoestroy
0
104
Member Avatar for Waseemn

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; …

Member Avatar for Narue
0
89
Member Avatar for scapu

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 …

Member Avatar for William Hemsworth
0
102
Member Avatar for usiel

What exactly do you need us to check? -Something must be going wrong because I get 34 errors trying to compile this

Member Avatar for usiel
0
95
Member Avatar for tigger0484
Member Avatar for tigger0484
0
264
Member Avatar for RatherBeInVegas
Member Avatar for daviddoria

uhm, not exactly sure, but mabey the itoa function automaticly allocates the appropriate memory?

Member Avatar for Narue
0
114
Member Avatar for alexhkleung

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]

Member Avatar for alexhkleung
0
121
Member Avatar for digital_ice7
Member Avatar for mukulbudania

This should work for a left click: [CODE] mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); [/CODE]

Member Avatar for Black Magic
0
114
Member Avatar for random7

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]

Member Avatar for William Hemsworth
0
192
Member Avatar for curt1203

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 …

Member Avatar for sinkingships7
0
139
Member Avatar for cedtech23

Make a 2D array. char fname[100][50]; fname[0] = "First Name1"; fname[1] = "First Name2"; ... and so on

Member Avatar for Ancient Dragon
0
173
Member Avatar for William Hemsworth

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 …

Member Avatar for William Hemsworth
0
200
Member Avatar for johnnyboy269

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); …

Member Avatar for William Hemsworth
0
92
Member Avatar for Jennifer84

[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 =]

Member Avatar for Jennifer84
0
116
Member Avatar for sumit

The End.