Beginners - June 2014 (Page 24)

Program4
 
Hello! I just compiled a program using these instructions: Prompt the user to enter the age of the recipient and assign it to an int variable age. Have yo...
[9 replies] Last: @wildblue what if the OP meant ||? :P Original code would have been... (by wildblue)
by akif13
How to access private members
 
Hi. I received errors such as float bmi is a private members. How can I access the private members in the main? Thanks in advance #include <iostream> using...
[2 replies] Last: Also, a person with BMI of 18.5 is not obese. (by Abramus)
by bonho
Publish / subscribe program
 
I'm writing a pub/sub program and is wondering the fundamental differences between QuantLib's Observable/Observer method vs boost:signals2 . Can anyone shred s...
[1 reply] : The Observable/Observer approach lacks of flexibility. It needs a part... (by coder777)
program5
 
Hello, I moved to next exercise. The original was: Prompt the user to enter the age of the recipient and assign it to an int variable age. Have your progr...
[6 replies] Last: [quote=justinelandichoruiz]here is the fix code No. Read the task de... (by keskiverto)
Save and Load text file
 
Trying to write a way to save and load a game. and i have done this to test it. now the problem i have is that when i enter A as lets say 4 and enter B as sa...
[2 replies] Last: You can also use Save << A << " "; (by Atyab)
error with unordered_map + hash functiom
 
First, I just learn hashing Second, I wrote the following code to: Whether unordered_set is subset of another unordered_set or not using hash function: Exa...
[7 replies] Last: could you show me please how to provide hashing function for Candidat... (by MiiNiPaa)
enum initializing
 
how can i initialize double or char or string to enum? enum players{ player_1=/*'a'*/, player_2=2.3, player_3="/*string*/, };
[5 replies] Last: No it is not an enum. You cannot use enum the way you want because the... (by MiiNiPaa)
by venros
C++ Sort & Operator Overloading < (less than)
 
I have a vector of pointers that point to Objects(string name, int score). I want it to sort the objects based on score, if object 1 and object 2 have the same...
[9 replies] Last: what If I had multiple classes and wanted 1 vector of pointers to com... (by MiiNiPaa)
Allocating dynamic memory class in void function
 
I am having trouble allocating dynamic memory to a class in a void function and later using it in the main function. When I try to run it, I get the following ...
[3 replies] Last: Making your code obfuscated and then complaining that it doesn't work.... (by ne555)
Compilation problem: pointer
 
Hi guys ! I'm a beginner in C++ and I create a program to apply the linked list concept. I've one file which contain a main program using my new class I impl...
[1 reply] : mySortedStack::pop() invalidates this->next. See if you can spot why. (by helios)
C++ Question Solved
 
Hi all. I am new to the forums and have been working on a game application and have come across a somewhat annoying error i cannot seem to correct. This applica...
[12 replies] Last: thanks! I can do both actually and prefer to read and see it. Ill chec... (by DreamAces80)
by Falek
Replacing user entered data and only accepting numbers
 
I need to make a program and part of the program needs to get the users social security number and display it with the numbers being replaced by X. For example,...
[3 replies] Last: will only accept numbers #include <iostream> #include <string> #inc... (by closed account j3Rz8vqX)
I'm having a problem on passing a struct array to a function. Help me please.
 
I'm now getting closer to finishing my program but I am having a problem in outputting my inventory. What's wrong with my code? (Our instructor told us not to t...
[2 replies] Last: Looks like you need modify line 116 to PDISPLAY(newProd, val); a... (by dangrr888)
by h4ever
is there non const variant of c_str()?
 
is there non const variant of c_str()? I used this to convert from string to char const char * cpath = path.c_str(); now I found I need to trim the stri...
[14 replies] Last: Is it possible to use similar solution but for char * buffer It uses ... (by MiiNiPaa)
Program7
 
Write your question here. Hello! I moved to next task, to write a program that converts miles into kilometers. Note that there are 1.609 kilometers in a mil...
[1 reply] : line 13 should be either int a; or better yet int mile; I would al... (by giblit)
Replacing Permutations within a string
 
I have a problem. I have a string of determined length that includes 1s, 0s and ?s. For example, my string is 001110101?1?110?. From this string, I have to calc...
[1 reply] : Binary counting will give you the combinations. e.g. 00000000 000000... (by mik2718)
by mehak
reference
 
can anybody tell me what is there in a no null reference?
[1 reply] : You cannot bind a reference to nonexisting object (without some tricke... (by MiiNiPaa)
by mehak
objects
 
is the global data member shared among the various objects of the same class?(this is true in case of static variables)
[4 replies] Last: thnku :) (by mehak)
by mehak
destructors,constructors,virtual functions
 
when an object of child class is created,first the parent class constructor is executed and then the child class.I hav a doubt as to which status function will ...
[1 reply] : Constructors are called in order from most base to most derived class... (by MiiNiPaa)
by tdk93
How does this program work
 
How does the following program work? What's the use of 34 here? #include <stdio.h> char *str = "charr* str = %c%s%c;main(){printf(str,34,str,34);}"; ...
[2 replies] Last: Effectively all it's doing is something like this; printf("%c%s%c... (by Chervil)
June 2014 Pages: 1... 2223242526... 48
  Archived months: [may2014] [jul2014]

This is an archived page. To post a new message, go to the current page.