Beginners - July 2012 (Page 38)

by safoex
Shortest code a+b (1,2)
 
the shortest one that I know is: #include <fstream> main(){ int a,b; std::ifstream ("input.txt")>>a>>b; std::ofstream ("output.txt")<<a+b; } (if comp. allows...
[20 replies] Last: @Peter87 I think it's fine to call operator<< and operator>> on th... (by vlad from moscow)
Giving "main" and argument???
 
what does it mean when an argument is inserted inside main like this? int main(int argc, char **argv);
[1 reply] : That's the commandline used to run the program. If, for example you... (by Disch)
Assert(what argument does it take?)
 
what argument does assert take? The argument from a library, states below, won't run since it doesn't like the assertion of the pointer below. Why is it? ...
[2 replies] Last: The error I get is below, apparently the iterator won't recognise the ... (by Blessman11)
Account balances
 
I am getting the error 'Account::credit' : must return a value... any help would be greatly appreciated. #include <iostream> #include <string> using nam...
[3 replies] Last: Yay!! That was my very first helpful answer, whoo hooo! :) (by vanllabean81)
What is the need of libraries?
 
If all libraries for c++ are written in c++ what is the need to build the source files into a library and then use them? It would make sense to build librari...
[3 replies] Last: That's a great answer, Moschops! So helpful, you are. Lol. (by vanllabean81)
Interest calculator
 
Ok, trying to make a compound interest calculator that reads the input from a file then computes the total at the end. I'm having problems with my forumla as i...
[3 replies] Last: So you want to calculate the interest on a specific deposit, then each... (by Phil123)
Program Skipping getline Statement
 
I am working on an encryption code and am just about done. Now I just need to ask the user what to name the file that they want to write the encryption to. Howe...
[8 replies] Last: (71) : error C2780: 'const _Ty &std::max(const _Ty &,const _Ty &,_Pr)... (by Phil123)
How can I make a random response generator? (1,2)
 
I'm writing this program, and I want to know if there is a way to have it display "good" or "bad" depending on a random response generator. Thanks. #includ...
[29 replies] Last: There is a few ways to do this. 1) int randomquestion = rand() % 4; if... (by Volatile Pulse)
My program closes unexpectedly
 
I built a program that asks for numbers and you have to do tasks with them (add one, double). The first "level" works fine, but the second one wont start. What...
[6 replies] Last: 2 things: 1- when you have this using namespace std; put it afte... (by ThangDo)
"pass object around"?
 
hello everybody. i have a question that i believe it's very simple. id' like to know how to share a object between many functions. for example, let's consid...
[6 replies] Last: I'm not sure I understand the question but, As long as you say "pu... (by sfBlackfox)
Meaning of Static and Const
 
Hi all! Could anybody please explain to me the meaning and use of the keywords static and const ? And the meaning of const in the following code: con...
[1 reply] : In this context, it's signifying that the function is read only and do... (by MrHutch)
Calculator works.. but not with a loop
 
I have a do while loop in "setCalc". The code runs, but the program freezes and doesn't work after I ask for z (answer). It works perfectly fine without any loo...
[4 replies] Last: there is no input... "input" never changes and will run forever with n... (by Jikax)
What could I improve upon?
 
http://pastebin.com/04utKxbt What could I improve upon? Aside from the system call, which I will remove soon. Thanks guys. :blackhat:
[14 replies] Last: Character *hero = new Character(ch == 1?"Gandorf":"Ashe", ch == 1?70:... (by ne555)
hi , can you help me guys
 
hi guys iam not much in c++ but iam old in games programming by action script it all debend on the events so the function are so easy but here in c++ i got some...
[6 replies] Last: here the question 1- add new patient 2- edit patient data 3-add new ... (by thunderxlight)
Skipping input of elements in line
 
Good day, I am writing a code in which it would be good to skip some elements in line from file that I use as input. For example: Let us say I have th...
[no replies]
One container with different data types
 
Hi,could You help me: I would like to make container like array or vector with variables of different types (say int, double, complex, etc). The problem is i d...
[1 reply] : You should look up boost::any which is an implementation for a heterog... (by Texan40)
Basic Compiling
 
I have created a shell script to run and compile my c++ programmes. I'm pondering, if there are any reason to why this may be discouraged, or a bad idea? ...
[3 replies] Last: Thanks for your advice, I didn't realise that's what a make file did, ... (by TakingSIdes)
Keyword this
 
Hi all! Could anybody explain the meaning and use of this ? I searched various websites, but I didn't find a clear answer. Thanks in advance!
[8 replies] Last: Thanks all for the help! And thanks, computergeek, for the effort of w... (by Fransje)
String Compare
 
This programm is asking the employee to inter her or his job category e.g"Technical Staff" or "Administration Staff" then the program should ask the years the e...
[9 replies] Last: @LovestoCpp its working.. (by hombakazij)
how to change the bit depth of a bmp in c++
 
I want to chang a bmp with the bit depth of 16-bit into 8bit in c++, but I don`t know how to do. thanks
[1 reply] : You could use some kind of library, or get to know the BMP format, rea... (by Peter87)
July 2012 Pages: 1... 3637383940... 54
  Archived months: [jun2012] [aug2012]

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