Beginners - June 2017 (Page 2)

about command line arguments
I want to print out a report that report the total number of lines if the user enters "-r" as the first argument : I tried it this way but the program will...
Jun 28, 2017 at 3:44pm
[10 replies] Last: No, it returns a number less than, equal to, or greater than zero, de... (by lastchance)
Using "std::find" from the algorithm librairy for a list of struct?
Hi, I'm trying to write a method that returns true or false whether this element exists in my list. Basically, I have a list of a struct. struct Person { ...
Jun 28, 2017 at 3:25pm
[4 replies] Last: auto list= listPerson; I believe this makes a copy of the list. Tha... (by dhayden)
Question regarding assigning inputs to different data types
Hello all, This is my first post. I am taking an online summer beginning c++ course. We are using C++ programming from problem analysis to program design 7th...
Jun 28, 2017 at 11:30am
[4 replies] Last: My mistake on 'a'. You are correct that it would read 47, '1' and 8 I... (by dhayden)
Output without coding display
How i can make a file to display the output of c++ coding done in codeblocks without displaying the coding. I would prefer the file to be cross platform. T...
Jun 28, 2017 at 10:00am
[10 replies] Last: [quote=jonnin]you can write the output to a web page (which can be a f... (by Enoizat)
Change file's name at runtime?
How would I change the name of the file executed at runtime? Pseudo code: run Do some things change name from notrunning.exe to running.exe do some mor...
Jun 28, 2017 at 8:51am
[3 replies] Last: The following worked on Windows (rather to my horror). #include <cst... (by lastchance)
by Meden
Database as a storage option
This last spring I had taken a C++ course at a local community college. It was a one day per week arrangement, so by the time that day came I always had a load...
Jun 28, 2017 at 6:53am
[2 replies] Last: It is possible. It depends what database server you want to use. Norma... (by TwilightSpectre)
Object behaviours
Lets say in the code below I create an instance of X called obj and then store something and then return it. Will this obj get destroyed after being passed? ...
Jun 28, 2017 at 6:40am
[1 reply] : I'll assume you mean something like: struct X { int val; }; X... (by TwilightSpectre)
How do I build a data structure with objects as member variables?
I recently started research that involved coding in cpp which I'm completely new to, and am having trouble with a bunch of stuff: 1. Default constructors 2. C...
Jun 28, 2017 at 3:41am
[3 replies] Last: I'm using the c_str() because I believe the constructor for ifstream... (by jlb)
how to pass 2 arguments into Command Argument
how do i pass in 2 arguments into the Command Arguments of Project Property ? can i write something as this: where the 2 arguments are seperated by a space ?...
Jun 28, 2017 at 12:45am
[1 reply] : Have you tried using getopt_long? There's a good example here https://... (by ivar5000)
HW/Assignment Issue While Loop Misbehavin'
Hello, I have been asked to create the following output using a loop: How much do you want to save each month? 100 Month 1: $0 deposited 100 interest earned ...
Jun 27, 2017 at 2:56pm
[5 replies] Last: Let's look at the output and be clear about what's getting printed: - ... (by dhayden)
Unknown Operator
Hi everybody, I was looking at some code and I noticed the following line: for (auto ch : _params.ch) What does the ':' operator mean in this cas...
Jun 27, 2017 at 1:20pm
[3 replies] Last: Thank you to both of you! (by christianwos)
how to convert at txt file to html
i am trying to write a program that reads a txt file and converts it into html 1.0 file. The header html file should start with the following structure: ...
Jun 27, 2017 at 11:10am
[3 replies] Last: Hello masterinex, I have a program that is similar to what you are tr... (by Handy Andy)
by EERD
Overload
Hi all. I have some questions and please help me, I have exam and i need answers. So I need to know what is a difference Between: 1) Function overloading, ...
Jun 27, 2017 at 3:29am
[1 reply] : function overloading is have 2 versions of the same function. operato... (by jonnin)
Design questions - creating a command line interface and controlling privilege level
Hello, I am writing a console application which needs to print certain messages while performing calculations and have the ability to respond to some command-l...
Jun 26, 2017 at 9:10pm
[4 replies] Last: perfect, thanks a lot Thomas1965!, got it (by erixliechtenstein)
font color error
I am trying to change the baackground color and the font color in c++ but 'codeblocks' only reads the last system("color _ _") #include<iostream> #includ...
Jun 26, 2017 at 4:44pm
[10 replies] Last: Hello suyashsing234, Your welcome. Sometimes it is the little things... (by Handy Andy)
what is type casting of classes and where is it used??
hi, can anybody tell me what is type casting of classes and where it is used? I googled it and I found a program on this website but I did not understand ...
Jun 26, 2017 at 4:33pm
[3 replies] Last: It's a const reference to an object of type A . (by MikeyBoy)
explaination of static in layman's language
I looked up everywhere but really can't understand how static works.Can you tell me its overview in layman's language. Not too much explaination just a little b...
Jun 26, 2017 at 3:35pm
[1 reply] : The static keyword has many uses in C++. static local variables If ... (by Peter87)
goto for an integer
How to do i use goto for an integer? when i use goto label; label: it works but when i use goto 0; 0: it doesnt work. I tried everything.:(
Jun 26, 2017 at 3:30pm
[5 replies] Last: > so what should i use instead of goto which is also as simple as goto... (by JLBorges)
by xari2
function void main()
#include<iostream> using namespace std; int i; void main() { i=10; cout<<"\n"<<"in main(), the value of i is:"<<i; f(); cout<<"\n"<<" back in main...
Jun 26, 2017 at 2:57pm
[2 replies] Last: see what tulu wrote and instead of void main() use int main() and befo... (by closed account 1vf9z8AR)
by darje
binary files
when i try to write binary in visual studio i write to text file .. and i cant see nothing even gebris i cant see. whice files i need to work with ..to read...
Jun 26, 2017 at 2:25pm
[2 replies] Last: you have to put a flag on the file open. fn.open(file, ios::binary); ... (by jonnin)
June 2017 Pages: 1234... 16
  Archived months: [may2017] [jul2017]

This is an archived page. To post a new message, go to the current page.
Registered users can post in this forum.