Beginners - March 2015 (Page 5)

cout not a member of std
 
My cout isn't working. I have upstream so what's up? #include <stdio.h> #include <iostream> #include <fstream> #include <string> using namespace s...
[1 reply] : On line 57? cout does not have a capital C, and identifiers are case... (by Zhuge)
PLEASE HELP PROGRAM ERROR
 
Hello. I'm having trouble getting this program to run. It keeps telling my I have an unutilized local variable but I cant figure it out. Here is the descript...
[11 replies] Last: Debugging does not mean reading through your code. Not even close. ht... (by TarikNeaj)
variables not initialized?
 
I'm being told my code won't compile because my variables aren't initialized but when I run it (using xCode) it runs just fine? I looked it over and everything ...
[8 replies] Last: Thanks :) (by closed account zT4NhbRD)
Functions for getting prefix
 
I have this right now but I am not sure what to put for return for case 2. I want it to return the first two digits of the number not reversed. For example ...
[9 replies] Last: I dont think my professor is dumb but maybe just loves to challenge us... (by PaliiBenet)
C++ I/O and Basic Calculation
 
Hello all you wonderful genius programmers. I have to take a computer programming class as a prerequisite to get into nursing school...unfortunately I have abso...
[1 reply] : First of all. I have to take a computer programming class as a prer... (by TarikNeaj)
While loop
 
Not sure what I am doing wrong, but 1-99 work with this code but not 0 or 100. However if I change to while (a>=0||a<=100) nothing works. I need to have 0 and 1...
[4 replies] Last: Thanks the program requires both a while loop and a do while loop doin... (by tygerrock)
by DBAC
Sum/Average from input file to output file
 
Read floating values from the file inputfile.txt and write the sum,average,and number of valid input values to the output file outputfile.txt. I have most of it...
[5 replies] Last: Did you manage to get all of the program to work? Edit: Looks like yo... (by TarikNeaj)
Structure Questions
 
Hi, I'm currently learning about structures and I would like to know what the difference is between initialising a structure like this: struct player he...
[14 replies] Last: Alright, that clears that up. Thank you very much for all your help, I... (by Bogeyman)
Need help with file handling
 
Hey I need some help with file handling. I am making a math quiz. I am stuck on the last task of my work. This is the task specification. (any advice would be m...
[2 replies] Last: Atm moment the code just saves the students score in a text file in th... (by Adem Penver)
Syntax Error: Expected an expression.
 
I'm getting a syntax error on the second << (the one just after FIRSTNAME) in the second line of instructor provided code. I don't know what I'm doing wrong. Al...
[4 replies] Last: I figured it out. Source.cpp code: cout << "\n" << FIRSTNAME << "... (by Moredom)
Loops
 
In a laboratory experiment, readings of certain measurement are entered instantaneously to a computer one after the other for processing. Write a C++ program th...
[8 replies] Last: Glad I could help, a big improvement from your last posts :D (by TarikNeaj)
How to get a prefix for a credit card number
 
What I am trying to do is get a credit card number from the user, reverse it, and use the first and second digit to get a prefix depending on how much numbers I...
[1 reply] : just fetch the first two digits before reversing the code by dividing ... (by shadder)
Arrays
 
Hi
[5 replies] Last: This is part of the code I wrote when responding to another minesweepe... (by fg109)
Cannot convert Class::object
 
Hi folks. I've (hopefully) created a vector of objects (Trolls in a rougelike). Each object should have an x and y coordinate set. I'm attempting to see if ...
[4 replies] Last: Works perfectly, cheers guys! (by Superelastic)
How to reverse the loop?
 
Write a C++ program to generate and print out the following series (using a single for loop): 10 8 6 4 2 0 2 4 6 8 10 //This prints (10 ...
[2 replies] Last: for(c1=10;c1>=(-10);c1-=2)//extending loop to -10 { int j=abs(c1); ... (by shadder)
Binary Search functin problem
 
I've written the following binary search program using template. But when I run it, it gives an error: 55|error: no matching function for call to ‘Binary_Sea...
[1 reply] : int Binary_Search(T& Array, T& Size, T& Value) Thats not quite how ... (by TarikNeaj)
Question about design/performance between two ways of storing all game objects.
 
What's better - a single vector with all gameobjects derived from the same base class (and using dynamic_cast), or multiple vectors? something like this: s...
[no replies]
Read from file to an array of pointers
 
I have an assignment where I have to read a file into an array of pointers for a "Parts" object. I'm stuck. I think I get the logic of it, but I need help think...
[no replies]
Sequences ?
 
What are those sequences :/ ! **3 4 6 8 9 12 15 16 18 20 **5 6 8 10 11 14 17 18 20 22
[4 replies] Last: I just need a hint . not the exact code .. and the previous attempts w... (by NahlaWael)
A vector of class that has vectors, can it be done?
 
I know an array must know the total size of objects it holds, but what about vectors? If I have a class, named Widget, and that class has vectors for data m...
[4 replies] Last: I didn't explain myself very well. Imagine having a pointer to an arr... (by Jims)
March 2015 Pages: 1... 34567... 51
  Archived months: [feb2015] [apr2015]

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