General C++ Programming - October 2016 (Page 20)

How to read a Files Data (1,2)
 
So I am trying to read in the first line from a file. When I run the program it just displays blank lines. WHY?? Here is the info in the file: Height Radius...
[28 replies] Last: > So what should I put there for it to print the first line of the fil... (by JLBorges)
Urgent!!!
 
Write a C++ program to count the number of words ending with 's' from the text file India.txt.
[4 replies] Last: It seems some kids don't read the rules. http://www.cplusplus.com/for... (by SamuelAdams)
using functions to convert measurements
 
I have to write a program that requires the use of four functions, one for the input, two for calculation and one for output of the calculated values. The pu...
[2 replies] Last: Hello naiuccorle, Please read http://www.cplusplus.com/forum/beginner... (by Handy Andy)
Recursive function for Linked List (missing first value)
 
Hi there! I have been brushing up on Linked List as personal practice, and I have recently implemented a Linked List class in List.h as shown below: #ifnd...
[2 replies] Last: @OP, I think if you take lines 114 and 115 and move them to after the... (by doug4)
Linked List (destructor/assignment operator)
 
Hello guys, I'm starting to learn about classes and created a Linked List using it, it looks like this; #include <iostream> #include <stdio.h> #include <s...
[10 replies] Last: Awesome! But the assignment operator, you can show that one aswell? I ... (by Willo123)
check if an array of char is filled correctly
 
I have to create a data member named number inside a class named account. The variable number is an array of char and the valid values are any string that start...
[1 reply] : If I understand your question properly, I think what you are trying to... (by doug4)
Defining Functions
 
1) Write the definition of a function isEven, which receives an integer parameter and returns true if the parameter 's value is even, and false otherwise. ...
[4 replies] Last: signed vs. unsigned != positive vs. negative. (by doug4)
How do I initialize an array with a function?
 
I wanted to do something like: int myArr ; setArray(myArr,4, 1, 7, 9); Note that 4 elements are passed to the function after the array, because 4 is th...
[19 replies] Last: What can I say... I really thank you for the time spent and for your ... (by gedamial)
assignment assistance
 
I have an assignment due soon and I'm having trouble with some of the functionality. Basically, this menu is dictated by switch cases containing functions that ...
[2 replies] Last: 1. [code firstline=204]if (usageCheck_1 = true) cout<<"Enter the numbe... (by SakurasouBusters)
Ignore certain character
 
Hey guys, I just wanted to know how I can ignore certain input from users. For example, I am writing a program to calculate how many days the user has been aliv...
[9 replies] Last: Believe what you want. (by Duthomhas)
programming assignment help
 
Create a C++ program that calculates sin, cos, and tan of the input value that is in degrees. You must show 6 digits below the decimal point for the output. EL...
[2 replies] Last: it worked when I used Xcode. I started the program while i was on camp... (by aqmorgan12)
modifying the code
 
Hello all!! i need help modifying this code to print out these exact outputs using nested loops. i = 1 j = 2 i = 1 j = 3 ...
[1 reply] : #include <iostream> using namespace std; int main() { int i, j; ... (by SakurasouBusters)
LCR dice game
 
Ok, so this is my final project for school and I'm really struggling with it. I've got till Sunday to finish it up, so I'm here to ask for help finally. The...
[no replies]
c++ i need some help
 
Write a program that uses a while loop to read in test scores until the user enters a negative number. Print the average score after dropping the highest and l...
[1 reply] : what is your question ? (by SamuelAdams)
How to use seekg to find line
 
Haven't really gotten a proper answer for this question. So I have a binary file which consists of data arranged by line, It looks like: 25 40 60 340 ...
[no replies]
Help please :(
 
#include <iostream> using namespace std; int fun (int a, int b=2) { return 3*a + 2*b +1; } float fun (float a, float b = 2.0) { retur...
[3 replies] Last: Perfect! (by theturk1234)
Why does placing a function inside parenthesis disable ADL for that function?
 
Hi, I found in good literature that: template<typename T> void Sample4( T t) { S4Helpers::bar(t); // disables ADT (Argument Dependent Lookup) (b...
[3 replies] Last: Thanks JLBorges once again!! theturk1234: I guess if bar were a type ... (by JUAN DENT)
Iterating over a reference to a map
 
Hello I have a function returning a reference to a map, something like this: const std::map<T1, T2>& get_some_map(void) const { ... } void main(void) { ...
[1 reply] : const std::map<T1, T2>& some_map = get_some_map(); // const map std:... (by JLBorges)
Program access
 
I am seeking clarification on a problem that surprisingly is largely ignored by every textbook on C++ that I have read so far. C++ is very efficient at "...
[16 replies] Last: I have added the following improvements. bool Materials::yes_no_inp... (by Coubarrie)
2D array traversing
 
I have a 2D array with objectA that starts at 5,5. Then I have objectB that is random. My problem is my ObjectA gets stuck at 0,9 and won't move right after. I ...
[1 reply] : Please explain your problem clearly using as much code as possible. A... (by theturk1234)
October 2016 Pages: 1... 181920212223
  Archived months: [sep2016] [nov2016]

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