49,761 Topics

Member Avatar for
Member Avatar for aslam.junaid786

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

Member Avatar for aslam.junaid786
0
210
Member Avatar for dshiells

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 …

Member Avatar for dshiells
0
221
Member Avatar for iamthesgt

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

Member Avatar for theguitarist
0
526
Member Avatar for triumphost

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

Member Avatar for mike_2000_17
0
222
Member Avatar for TheBrick

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 …

Member Avatar for mike_2000_17
0
136
Member Avatar for CodyOebel

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

Member Avatar for Ancient Dragon
0
2K
Member Avatar for peymankop

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

Member Avatar for Lucaci Andrew
0
127
Member Avatar for anukavi

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 …

0
103
Member Avatar for myk45

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

Member Avatar for myk45
0
679
Member Avatar for pjh-10

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

Member Avatar for vmanes
0
228
Member Avatar for James19142

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 …

Member Avatar for James19142
0
2K
Member Avatar for efe.ozyer

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

Member Avatar for tinstaafl
0
474
Member Avatar for xxwikkixx

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 …

Member Avatar for theguitarist
0
167
Member Avatar for gamnlxvi

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

Member Avatar for deceptikon
0
547
Member Avatar for karan.rks

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 …

Member Avatar for Ancient Dragon
0
362
Member Avatar for amit43

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 …

Member Avatar for Lucaci Andrew
0
80
Member Avatar for gamnlxvi

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

Member Avatar for gamnlxvi
-1
213
Member Avatar for inneedofhelp123
Member Avatar for inneedofhelp123
Member Avatar for Knowledge72
1
229
Member Avatar for BirdaoGwra

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

Member Avatar for BirdaoGwra
0
194
Member Avatar for opel123

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

Member Avatar for opel123
0
237
Member Avatar for opel123
Member Avatar for angel.heaven.58367

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 …

Member Avatar for mike_2000_17
0
139
Member Avatar for kshahnazari

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 …

Member Avatar for Gonbe
0
145
Member Avatar for nivedita.valluru

How to call a C++ function which is compiled with C++ compiler in C code?

Member Avatar for deceptikon
0
102
Member Avatar for ssh9411

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 …

Member Avatar for Lucaci Andrew
0
157
Member Avatar for tomz6

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 …

0
67
Member Avatar for AndrewEPage

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

Member Avatar for mrnutty
0
3K
Member Avatar for clubberlangMayo

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 …

Member Avatar for clubberlangMayo
0
999
Member Avatar for proprogrammer

The End.