Beginners - October 2012 (Page 72)

by Ch1156
Really weird problem
 
Ok so i have a program that has you enter numbers and you get a score, i am testing it along the way and when you enter 4 lines of numbers it gives me the error...
[2 replies] Last: Every time you use the >> operator the program is waiting for you to h... (by Lowest0ne)
by kassik
returning a 2d array from a function
 
Hi every body I am very beginner and I am trying to write a simple code. I want to call a function doing a few works in a 2d array and then return it's new valu...
[1 reply] : > I want to call a function doing a few works in a 2d array and then r... (by JLBorges)
variable of template class
 
Have template <int n> class TCombGenerate { ... viod generate(); ... }; Want declare variable smth like TCombGenerate<n> *gen; and do gen=new ...
[5 replies] Last: Oh sorry. I didn't pay attention to that the template argument was not... (by Peter87)
by Owain
dynamic_cast, static_cast and reintrepret_cast
 
Hello. My problem is not with what these operators do, but why they exist. I cant really think of a situation where you would need to use any of them. Could som...
[13 replies] Last: AFAIK the only time they perform a reinterpret_cast is when doing a s... (by clanmjc)
help pleaseee!
 
i am working on a program for a project where we are given a txt file containing a country, its number of gold, silver, and bronze medals, and its population. ...
[5 replies] Last: You are welcome & thank you (by vichu8888)
by Aceix
Meaning of stack, buffer and heap.
 
As the question states, can I know what the heap, buffer and stack are? and what do they do? And when one says the stack "grows down the address space", what d...
[11 replies] Last: Thank you very much. Problem solved. Aceix. (by Aceix)
c++ help
 
Ok I have been given an assignment in which I must write a program which asks for the number of students in a class, which you then enter (and it must be betwee...
[3 replies] Last: thank you. and sorry about that, I'm new to this website. (by jlmckelvey91)
is it codeblocks that doesnt like string? cant debug my code untill i know its not a compiler bug
 
So i finished studying buckys awsome youtube classes, ive understood the entire dev hq tutorial as much as i can without practicing my own code, so i found a ...
[3 replies] Last: It's not a compiler bug. That's generally the last place to look for p... (by Chervil)
Nightmare working with array
 
Hello everyone, I am new to C++ and I am taking an online class in programming C++ and I am completely lost in this chapter. I have been working on a problem f...
[2 replies] Last: Thank you for your reply. I noticed the change with total. If you ta... (by geowalsh3)
C++ prime number program
 
I've been at this for a while and i can't find an answer, i need the program to display prime when a prime number is entered (while looping infinitely) and i ha...
[1 reply] : I hate giving this answer, but please - search it here or in google. I... (by tath)
If its not nth power of 2, break
 
Hello why doesnt the line with pow(k, 2) work: if its not nth power of 2, break... it doesnt break? for(int i=0; a<100; i++){ array =a; a=2*a; } for(int ...
[2 replies] Last: 1. make sure you have inserted math header file 2. pow doesnt work fo... (by vichu8888)
by den213
Random numbers, Display the highest, second highest, and the lowest number.
 
#include <iostream> #include <time.h> using namespace std; int main() { const int num = 10; int ran , high =0, high2, low = 16; srand(time(NULL)); //co...
[2 replies] Last: it still displays the duplicate. ex set. 15 12 15 13 8 6 4 5 9 10 it... (by den213)
Help with If Statements
 
#include <iostream> using namespace std; int computeTax (float income,int percent); int main() { float income; int percent; // prompt th...
[3 replies] Last: thank you guys very much! all of it helped and hopefully ill avoid it ... (by mckizzlealmond)
template curiosity
 
Just for curiosity: Is there a way to avoid this rarely annoying case? template<typename T> inline VectorT<T> operator*(T s, const VectorT<T> &v) { return...
[1 reply] : Perhaps the simplest way is to use two type parameters for the templat... (by JLBorges)
Read and write to a text file
 
read from data.txt file and write to results.txt in c drive. here is the data.txt file (didn't press enter after number 5): 3 4 5 everything runs but...
[4 replies] Last: i can't specifically extract the numbers from data.txt instead of cre... (by s123456)
Getting program to exit with user input
 
I have to exit the program when the user inputs e, but for some reason it continues. I am just not seeing what the problem is. Here is the code for the functio...
[1 reply] : case 'E': cout << "E - Exit Program" << endl << endl; ... (by TheJJJunk)
How to check a string for digits
 
I need to check a string and make sure it only has digits. I know how to check certain positions inside the string with (isdigit(str )) but is there a way to ch...
[3 replies] Last: oh well i tried. (by Aramil of Elixia)
ad hoc scanner issues, unable to determine the problem
 
So far i have this code that is suppose to be an ad hoc scanner, im not sure where exactly the problem is because i get a very odd error in the output.txt fil...
[1 reply] : In checkForDecimal: I don't think you want to do the x--. In checkFor... (by histrungalot)
While & do while loop
 
I've been trying to figure out what is going on within these two loops? Assuming all variables were of type int. i =1; while (i*i < 10) { j = i; ...
[1 reply] : What is the question? If you just want to know the values for the vari... (by maeriden)
Returning Errors
 
Hello everyone I am new to writing code and when I try to compile my code I keep getting back multiple errors. I'm not sure how to even distinguish what its te...
[2 replies] Last: Ok, thank you maeriden for the tips and the help! (by twitticus)
October 2012 Pages: 1... 7071727374... 84
  Archived months: [sep2012] [nov2012]

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