48,983 Topics

Member Avatar for
Member Avatar for nathan.pavlovsky

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 …

Member Avatar for nathan.pavlovsky
0
208
Member Avatar for cambalinho

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 …

Member Avatar for cambalinho
0
175
Member Avatar for alysha.recore

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 …

Member Avatar for NathanOliver
0
165
Member Avatar for mo_snow

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 …

Member Avatar for pritaeas
0
5K
Member Avatar for daniela.valkanova

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

Member Avatar for Learner010
0
140
Member Avatar for mo_snow

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 …

Member Avatar for rubberman
0
1K
Member Avatar for Jjajangmyeon

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 …

Member Avatar for rubberman
0
228
Member Avatar for daniela.valkanova

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

Member Avatar for daniela.valkanova
0
269
Member Avatar for can-mohan

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 …

Member Avatar for tinstaafl
0
296
Member Avatar for can-mohan

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 …

Member Avatar for NathanOliver
0
219
Member Avatar for BibhutiAlmighty

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

Member Avatar for Moschops
0
191
Member Avatar for meow123

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 …

0
176
Member Avatar for Vasthor

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

Member Avatar for Vasthor
0
132
Member Avatar for johans22

I am looking for a simple c/c++ code that converts 16b-greyscale image to raw format using tiffio.h?.

0
53
Member Avatar for efe.ozyer

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

Member Avatar for tinstaafl
0
134
Member Avatar for nathan.pavlovsky

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 …

Member Avatar for mike_2000_17
0
8K
Member Avatar for ansar.tiwana.15

All A template function must have at least ---------- generic data type 1Zero 2one 3two 4 three witch is answer is correct?

Member Avatar for vijaykhatri
0
84
Member Avatar for davin_six
Member Avatar for thefonz22

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 …

Member Avatar for ken.green.142035
-1
2K
Member Avatar for abb13e

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 …

Member Avatar for abb13e
0
271
Member Avatar for kshahnazari

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 …

Member Avatar for triumphost
0
7K
Member Avatar for Sarkurd

Hi what are Macros used for in C++? i never heard this word in my entire life :D and what are `assert()` and `NDEBUG`?

Member Avatar for Sarkurd
0
174
Member Avatar for Asma_2

i need your help to find c++ code for Clustering algorithm for energy efficiency in wireless sensor networks

Member Avatar for L7Sqr
0
269
Member Avatar for yapkm01

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.

Member Avatar for deceptikon
0
71
Member Avatar for kshahnazari

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 …

Member Avatar for Hiroshe
0
203
Member Avatar for yogesh_6

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 …

Member Avatar for rubberman
0
703
Member Avatar for nhrnjic6

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 …

Member Avatar for nhrnjic6
0
297
Member Avatar for daniela.valkanova

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

Member Avatar for tinstaafl
0
290
Member Avatar for cambalinho

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

Member Avatar for cambalinho
0
6K
Member Avatar for Daneos

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

Member Avatar for AceStryker
0
274

The End.