49,761 Topics

Member Avatar for
Member Avatar for amal.sultan.5855

how to find length of a character string without using while loop or user defined function?

Member Avatar for Gonbe
0
204
Member Avatar for Yahia Farghaly

Hi there, i was trying to make a program (to do)using list class here is the code #include<iostream> using namespace std; #include<list> #include<string> void display(const list<string>& lsy){ list<string>::const_iterator iter = lsy.cbegin(); int i = 0; while (iter != lsy.end()){ cout <<++i<<"- "<< *iter << endl; ++iter; } } void add(list<string>&ls){ …

Member Avatar for Yahia Farghaly
0
325
Member Avatar for Vagabond

The user is asked to input a number in either Hex, Octal or Decimal, which is then converted to Hex, Octal & Decimal. The user can exit the program from the MAIN MENU or by the Escape key after each convertion. Compiler : Borland Turbo C++ v4.5.

Member Avatar for pritaeas
1
1K
Member Avatar for furalise

Hello I am having some trouble with something. As I read the contents of a file into an ifstream object I occassionally want to dump all its contents into a stringstream to analyse it. Example below. The problem I am having is that if I use ifstream.rdbuf() to dumpt the …

Member Avatar for furalise
0
4K
Member Avatar for Xecantur

Having a hard time trying to wrap my head around why my grid system fails, I'm assuming my train of thought is stuck at the moment(akin to writers block). My understanding of grids is while the current cell isn't the last one in the column/row(w/e is horizontal) /*do stuff*/ then …

Member Avatar for Xecantur
0
326
Member Avatar for nhrnjic6

Is it possible to stop the lets say for loop with a function : for(int i = 0;i<15;i++){ cin >> input; obj.add(input); } // and then have some add or some other function that checks if (x == max_size) check(){ if(counter == max_size) stop the foor loop and continue.. }

Member Avatar for Xecantur
0
141
Member Avatar for Jjajangmyeon

This is driving me nuts. I'm writing a password program that reads from .txt file into an array of char arrays, and then allows the user to write a new password and then appends it to the end of the list. Everything SEEMS to be working except everytime I run …

Member Avatar for Jjajangmyeon
0
199
Member Avatar for cambalinho

i'm build a completed new code for properties: #include <iostream> #include <functional> using namespace std; template <typename T> class property { private: T PropertyValue; //i think these is ok, but something seems not std::function<T(void)> getf; std::function<void(T)> setf; public: property() { getf=NULL; setf=NULL; }; property(T value) { PropertyValue=value; }; property(std::function<void(void)> GetFunction=NULL,std::function<T(void)> …

Member Avatar for cambalinho
0
398
Member Avatar for cambalinho

i put an image on form with WM_PAINT message. but the image is, only, showed after resize(for example) the form. why is that? did i forget any style\extended style?

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

Hello programmers! I am working on a custom tree class [with the code example being copied from Dietl's C++ How to Program, 9th edition]. It is in my fashion to copy all the code examples in the book when reading it (for muscle memory), but the authors created a custom …

Member Avatar for nathan.pavlovsky
0
376
Member Avatar for nibiruisaplanet

It's a code to calculate age from today's current date. I know I'll have to use #include <ctime> But I have no idea what I would use for the rest. Here's my code: package practicing; import java.util.Calendar; import java.util.Date; import java.util.Scanner; public class FindRelativeAge { private static Calendar calendar = …

Member Avatar for vijayan121
0
358
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
209
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
176
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
167
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
141
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
308
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
270
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
299
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
223
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
178
Member Avatar for nancy10001
Member Avatar for ~s.o.s~
-1
383
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
143
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
55
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
136
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

The End.