49,761 Topics
| |
CODE #include "stdafx.h" #include<iostream> #include<conio.h> #include<string> #include<fstream> using namespace std; //---------------------------Function Prototypes----------------------------// void titleheader(); void menu(); void addbook(); void display(); //--------------------------Main Function---------------------------------// int _tmain(int argc, _TCHAR* argv[]) { int op; titleheader(); menu(); cout<<"\nPress option key to activate the required function: "; cin>>op; switch (op) { case 1: { system("cls"); titleheader(); … | |
Hi all, I want to create a separate class in my C++ application which creates a dialog from a resource, similar to extending CDialog in MFC, however I would like to avoid using MFC. For example, I would like to be able to run the following code in my WinMain … | |
I have a class Client that is the main class for my Windows C++ application. Inside the client class, I have a number of variables and functions. One variable I'm having trouble with is the manager: private IRManager* manager; The main function of my class is int APIENTRY InnoVisitClient::_tWinMain(HINSTANCE hInstance, … | |
I'm in a bit of a dilemma. I want to know what the difference is between Foo and Meh. I wrote both of them and I did not like Foo so I wrote Meh. They both work but is there an overhead to Meh? Is there anything bad about Meh? … | |
Hi, I'm not sure what forum to stick this in but seeing as the test was in C++ I thought I'd stick it here but feel free to move. I recently completed a test for a job application. I completed 2 out of the 3 questions (it was a choose … | |
I am just researched out in frustration. No matter what I do I get an error trying to declare InternetOpen. [CODE] #include <WININET.h> #include <windows.h> int main() { /// Other includes were taken out to keep post small HINTERNET hInternet = InternetOpen( "TestApp", INTERNET_OPEN_TYPE_PROXY, "www.oebelknives.com",0, INTERNET_FLAG_ASYNC ); //HINTERNET FTPOpen = … | |
Hi! i'm a bit new in c++ so i'v got some question wish you to answer me...! first of all i want my program to show the specific group of line of my file so i use this code for it: using namespace std; int main() { ifstream myfile; myfile.open("test.txt"); … | |
Hi, Before posting this question, i had gone thru related answers in many sites but cudnt get a solution to the problem. I have followed the step needed for Socket timeout, but the timeout eventually pass for the first time but fails for second time. Platform : VC++ 2012 MFC … | |
Hello All, I was experimenting with creating a large number of threads and checking how fast it runs on my machine.(details provided later) This is the code i'm using: #include <iostream> #include <thread> #include <ctime> #define THREADED 1 static const int num_threads = 100; static int mult_array[100][1000000]; void multResult(int *arr) … | |
having trouble finding this anywhere, on a 32bit computer, how many bytes does it take to store ; long int, unsigned char,float, double any help is much appreciated | |
I used `memcpy` to copy the contents of one pointer to another pointer assigned to new memory. Later in the program I get runtime errors as if I were attempting to operate on a pointer pointing to nothing. While debugging, I saw that the original and the the copied pointer … | |
BYTE GetByte(char* sBuf, int& index) { int t_index = index; index++; return (BYTE)(*(sBuf+t_index)); } int GetShort(char* sBuf, int& index) { index += 2; return *(short*)(sBuf+index-2); } and i cannot convert this | |
Hey everyone just to refresh my memory and practice some programming I decided to make the dice program here is my code: #include <iostream> #include <ctime> using namespace std; int main() { int input; int random; cout << " VIRTUAL DICE 1.0" << endl; cout << "Enter 1 to roll … | |
#include <iostream> #include <stdlib.h> //For system() #include <conio.h> //For getche() #include <time.h> using namespace std; //You can modify these numbers but don't delete these constants or this starting code will not work const int MAX_HEIGHT = 20; //The height of the grid const int MAX_WIDTH = 40; //The width of … | |
hey... I'm coding a program for my school project and i have come across a very different problem!! I was using graphics.h in my program... everything is running great.. even graphics are doing well... but after some time... that is after some input... the size of the text shrinks... and … | |
i want to know when we take the input using cin then what does '\n' and ' ' does. #include <iostream> #include <string> using namespace std; int main() { int x, y; string s; double a, b; cin >> x; cin >> y; cin >> s; cin >> a; cout … | |
#include <iostream> #include <stdlib.h> //For system() #include <conio.h> //For getche() #include <time.h> using namespace std; //You can modify these numbers but don't delete these constants or this starting code will not work const int MAX_HEIGHT = 20; //The height of the grid const int MAX_WIDTH = 40; //The width of … | |
How to find which operating system is running the PC in C++? | |
Can someone help me to make program which find duplicate files in C++? Thanks a lot! | |
Hi, This is prity basic question but I am a little stuck with it. I have a class with a member variable in it. There are three files, say a, b and c. in file b.cpp - class b { public: ----- ----- int i; } in file c.cpp - … | |
hi :) is there a possible way where in we can combine two rows for an example i have this code: #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream outfile; outfile.open("1stRow.txt"); for(int i=1;i<10;i++) outfile<<i<<endl; outfile.close(); ofstream outfile2; outfile2.open("2ndRow.txt"); for(int j=2;j<11;j++) outfile2<<j<<endl; outfile2.close(); //return 0; } … | |
how to include c++ dll in a windows application created in c#? | |
I am trying to do a problem of solid waste collection vehicle routing using Genetic algorithm in C++. So here raises the question why should I use GA. How do I defense this question? My main logic is solid waste collection problem is a non linear problem and for solving … | |
I have a recrusive program -Im new to it!- that gives all the possible ways to make a money to smaller coins for example : we want 10$ the coins are 5$ , 2$ , 1$ we can give 1 5$ , 2 2$ , 1 1$ or only 10 … | |
How to call a C++ function which is compiled with C++ compiler in C code? | |
I have an anagram program that if you type in a word's characters in any order, the dictionary file will be able to export it. However, my assignment is to build words that are shorter than the inputted search area in a one-to-one letter correspondance. An example of this would … | |
Hi, I need to make a video player. I have sequences of image data (bitmaps) which are very large (1920x1080), and need to display them onto the screen at least 60FPS. What is the most efficient way to do this so I won't get loading/displaying delays? PS: I'm thinking to … | |
Just a thought that woke me up this morning. A means of providing 'property' type constructs in C++ classes similar to python properties. # Header # #ifndef _HXX_CPROP #define _HXX_CPROP /** * Helper class to connect a 'property' in a * c++ class to getter/setter methods * */ template<class T, … | |
need to design a code for my first assignment in dev c++ for olmypic judging, 5 judges, 10 competitors, need to score each competitor between 0.0 and 5.0. i cant use the highest score for each competitor or the lowest and must average the remaining results. any help? i have … | |
The End.