48,983 Topics
|
|
Hi programmers! I am trying to grasp the concept of friendship. Let's say that we have the following: class List; //forward declaration class ListNode { friend class List; //make List a friend /* rest of code here, blah, blah, blah. */ } Does this mean that ListNode can access Lists's … |
|
heres a nice tutorial about regions: http://www.flipcode.com/archives/Win32_Window_Skinning.shtml like you see, these tutorial is for forms.. so how we can do with child controls!?! we can: add the WS_CLIPCHILDREN or WS_CLIPSIBLINGS style, when we create a button\other control: hwnd = CreateWindowEx( 0, TEXT("CBUTTON"), strCaption.c_str(), WS_CHILD | WS_VISIBLE | BS_TEXT | WS_TABSTOP … |
|
Hello everyone! I am in need of some help with a homework assignment. It's basically creating a file indexer using C++. I have 2 separate files that I need to read in: one is a text document and the other is a Skip words key. I am incredibly confused about … |
|
The MilTime class should convert time in military (24-hour) format to the standard time format used by the Time class. Theclass should have the following member variables: milHours : Contains the hour in 24-hour format. For example, 1:00 pm would be stored as 1300 hours, and 4:30 pm would be … |
|
> Not sure why do I always get a 0 from the isvalidReal function? int isvalidReal(string signedNum) { bool check; int i = 0, j = 1; string str = "+-."; for (i = 0; i <= signedNum.length(); i++) { if (isdigit(signedNum[i])) { check = 1; } else if (signedNum[0] … |
|
I posted a simliar issue ealier, but I've changed my approach since then. #ifndef TIME_H #define TIME_H class Time { public: Time(int = 0, int = 0, int = 0); ~Time(); int hour; // valid values are 0 to 23 int minute; // valid values are 0 to 59 int … |
|
I'm writing a program to parse a user entered string. My textbook does not include the .find() function, but I found it in an old C++ book (Ivor Horton's Beginning C++, the Complete Language) is the .find() considered bad, or depricated? It seems to work really well, but I don't … |
|
> The following letters are stored in an alphabet array: B, J, K, M, S, and Z. > Write and test a function named adlet(), which accepts the alphabet array and a new letter >as arguments, and then inserts the new letter in the correct alphabetical order in the array. … |
|
Guys, In below code after reading string values from vector , I can have output like("VarID","flag","count") for(int i=0; i < v.size(); i++){ cout<<v[i]<<endl; } All are (varID,flag and count)are string literal , now i need to populate the structre with this string literal. where VarID = int,flag=bool, count=Int. Can anybody … |
|
Guys, In below code they are couple of issues. (1) I am not able to read first key and value pair record from snmp.json file in my map, it just start reading after first record. (2) After reading the value from file in current implementation it is not reading the … |
|
How to play a sound file in c++. I am trying to make an alarm program. I've done everything but i need to play sound at certain time. please help.............. |
|
Hello, I am currently working on a binary search tree that acts as a phone book. I am nearly completed with it and all functions seem to work properly except in two cases: An error message will not print to the screen when trying to delete or edit for a … |
|
[Click Here](http://s8.postimg.org/ab4paaq8l/New_Bitmap_Image.png) is adding m_y, m_m, m_d, considered as cheating? if not, how to get the value for getYMD()'s param? |
|
I am looking for a simple c/c++ code that converts 16b-greyscale image to raw format using tiffio.h?. |
|
Hi, I want to show/hide my MFC Dialog from another class; Main App : HomeWorkApp Main Dlg : HomeWorkDlg #include "HomeWorkDlg.h" #include "HomeWorkApp.h" CWorkUser::CWorkUser() { // Initialize MFC Dialog here.. // How ?? MainDlg->ShowWindow(SW_SHOW); } CWorkUser::~CWorkUser() { // Finalize MFC Dialog here.. } Thanks.. |
|
Hello! I was creating a custom array class as an exercise in my exploring of class and function templates. Here's my header file: #include <iostream> template <typename el> class Array { friend std::ostream &operator<<(std::ostream&,const Array&); friend std::istream &operator>>(std::istream&,Array&); public: Array(const int& arraySize=0); //set all members of array with size arraySize … |
|
All A template function must have at least ---------- generic data type 1Zero 2one 3two 4 three witch is answer is correct? |
|
Use a DO WHILE loop |
|
Hi guys. There seems to be a lot of people on this forum who know what they are talking about. My question is simple. I'm fairly new to c++ and i have hit a brick wall. I'm trying to write a simple program that grabs 2 txt files and outputs … |
|
I dont clearly understand bool functions. this lends problems to my current assignment in class where i have to write a program that involves a bool function that tests for letters in a string that the user inputs. Can anyone offer help to me? the whole code is slightly confusing … |
|
hey , I'm trying to read a 24 bit bmp file but after reading the first pixel something goes wrong, any ideas? int i; FILE* f = fopen("Sample.bmp", "rb"); unsigned char info[54]; fread(info, sizeof(unsigned char), 54, f); // read the 54-byte header // extract image height and width from header … |
|
Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`? |
|
i need your help to find c++ code for Clustering algorithm for energy efficiency in wireless sensor networks |
|
I know that there's no solution book for C++ Primer 5th Edition by Stanley Lipmann but is there any on the web? Would appreciate any help on this. Thanks. |
|
Hi , I have a small 2d array and I want to check if it exists in a bigger 2d array. I have coded it but I don't know what am I doing wrong cause even if exists it won't detect it. 2 arrays are PI and NPI. PI is … |
|
This program hangs when I enter the number of vertices only..It does nothing..I am not able to figure out what's wrong with this.Please help #include<iostream> #include <list> using namespace std; // This class represents a directed graph using adjacency list representation class Graph { int V; // No. of vertices … |
|
OK. I just don't understand what is the problem here. Here's the code .h file : #ifndef NVECTOR_H #define NVECTOR_H class Nvector { public: //Nvector(); Nvector(int Size = 0); void addElement(int a, int index); void getElement(int index); void push_me_back(int a); void push_me_front(int a); private: int *p_array; int velicina; int *resize_array(int … |
|
int game() { int n; cout << "enter an odd number: "; cin >> n; int MagicSquare[n][n]; // It says that the expression must have a constant type? int newRow,newCol; int i = 0; int j = n / 2; for (int i = 0; i < n; i++) { … |
|
heres the code that i use for put the form transparent: LONG style= GetWindowLong(hwnd, GWL_EXSTYLE); style=style | WS_EX_LAYERED; SetWindowLong(hwnd, GWL_EXSTYLE, style); SetLayeredWindowAttributes(hwnd, clrBackColor, NULL, LWA_COLORKEY); but i see problems :( the form and the controls are showed, but the mouse events are ignored. if i click on button or form, … |
|
Hello, anyone can suggest me a simple lua wrapper with clean code? I want to call from c++ lua functions but I dont really get it.. I only know a little LUA and C++. Example lua function I have: Get the level: function Lv(a) local lv = GetChaAttr( a , … |
The End.