Beginners - May 2018

Need help with error line 89 File I/O
 
Need C++ Help. My instructor said the following after making many changes I am at lost it works when ofstream and ifstream are global but not when I move it dow...
[4 replies] Last: I apologize icy1 When I copied my code in from visual studio it format... (by josephhoffman28)
function that counts words in a string & function counts consonants in a string
 
I have to write two functions, one that counts words in a string and one that counts consonants in a string. I've already asked for user to input string in main...
[2 replies] Last: Hi, I hope this code help you. #include <stdio.h> #include <string... (by mr logic)
by rubili
find all substring in a string
 
Hi everybody! I have a difficulty when working with string. For example, I have a string: string str = "X1{V 4.3}-V1{V 3.2}"; I 'd like to read from the b...
[2 replies] Last: Hi, I am not sure if what I did is what you need, but here is what I d... (by mr logic)
Finding the average
 
For some reason I get 1.5 as a answer when it should be 2.5. I'm trying to find the number n for example 1234 number's sum average. 1 + 2 + 3 + 4 = 10 Average =...
[5 replies] Last: well if input is suddenly a string rather than an int, one need not ma... (by icy1)
by seanFE
Spatial Clustering
 
I am trying to produce an algorithm that analyzes a set of data points in 2D space to find clusters based on radius. Here's what I'm thinking in sort of pseu...
[1 reply] : I would do this in 2 steps. step 1: find the center of a group. You... (by jonnin)
Program Won't Output Correctly
 
Hi all, I have a program where I am to open a .dat file containing a list of flowers and whether or not they grow in the sun or shade and print it into a .cpp f...
[3 replies] Last: JLBorges' code does everything you requested, so what's the problem...... (by icy1)
by Dani90
Need help
 
Hello..i have a set of different correct integers and i want to form a series from this numbers so that the difference between two consecutive numbers in this ...
[3 replies] Last: Just realized that the answer doesn't necessarily need to start with t... (by icy1)
by ysf007
check vector element within another vector
 
I had to write a code which checks elements of vector A within vectors B such as I choose int just demonstration, it might be string, object etc: the content ...
[17 replies] Last: To my: "How many elements? You must have exact, computable rules for t... (by keskiverto)
Why does this for loop not work as it's supposed to?
 
The initial value for x is 3, but the condition is for x to be 4. Why does it pass as true and loop endlessly, while it is clearly supposed to be false and not ...
[1 reply] : Welcome, nice job finding it quickly. If you turn your compiler warn... (by jonnin)
by Boreal
Number of words
 
Hi, thanks for viewing my question. I am just starting with programming in C++ and I have an assignment that I am not quite sure how to do. I was able to look ...
[6 replies] Last: That's quite a nice solution right there icy1. Even though I have alre... (by Boreal)
by H00G0
Can you read data from a file on which data was written manually?
 
Hello! I'm Currently coding a game and am running into a small issue. In order to render levels, maps or whatever you want to call it, I use a Map class. The ...
[16 replies] Last: @Handy Andy Hey Andy, sorry It took me so long to respond. First of, t... (by H00G0)
cpp codes example (strings arrays.. 2 )
 
Lab 3 Q1 // Question 1.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <math.h> #define ...
[1 reply] : See http://www.cplusplus.com/forum/beginner/237662/#msg1061417 (by Handy Andy)
Cpp Codes example (strings arrays.. 1 )
 
Lab 1 Q2 // Q2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <iomanip> #include <cmath...
[1 reply] : Hello procppgram, PLEASE ALWAYS USE CODE TAGS (the <> formatting butt... (by Handy Andy)
write a program that display a menu
 
write a program that display a menu menu(chicken fish , prime rib ...) #include "stdafx.h" #include <iostream> //declerations for 5 functions calle...
[2 replies] Last: Hello procppgram. When I started working with the program I had to ma... (by Handy Andy)
by Lema
function ran even though it's not called
 
Hello everyone,im creating a program to input product that asks for itemName,size,amount,and hour+minute everything so far looks good, but when i compile and c...
[2 replies] Last: Switch statements are a bit primitive. If you don't use a break statem... (by Peter87)
Need help, getline problem
 
Display all professor. int main() { account Lst; string dismiss; ifstream inFile1; inFile1.open("Professor.txt", ios::in); if(!inFil...
[2 replies] Last: Thanks, it work properly. (by commencer)
Undefined reference to private variable
 
This is probably a very dumb error, but I can't figure out what's wrong with this code. Looked all over the internet and couldn't find a solution. shell.h ...
[2 replies] Last: Edited my makefile, thanks (by D3CIM8OR)
A simple translator (.txt)
 
Hi everyone, I am trying to recreate a program I did in school 10 years ago, which was the last time I did programming, and I am failing at the very first li...
[4 replies] Last: Here's some C++ code: #include <iostream> #include <string> #include... (by JLBorges)
Function that gets an array from pointers using Dynamic Memory Allocation
 
The instructions from my textbook are: Write a function int* read_data(int& size) that reads data from cin until the user terminates input by entering Q. The f...
[7 replies] Last: Thank you for all your help! Really appreciate it (by Jorge626)
Switch statement - are variables always retained?
 
I'm working on a piece of code in which I make use of a switch-statement, and I was hoping to have the following things clarified so I can advance: (a) is th...
[6 replies] Last: I wouldn't make it 'fall through', but put something like: case ONE:... (by Vitesze)
May 2018 Pages: 123... 19
  Archived months: [apr2018] [jun2018]

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