Beginners - March 2016 (Page 22)

Input and output file
 
Basically, my program will open the file "word.dat" and it will count and remove all the vowel to store it into another file called "text.out". However, I canno...
[1 reply] : > while (File >> sentence); note the semicolon at the end, that's th... (by ne555)
Runtime Error in Private Data Section
 
I am trying to create a random number generator for a C++ class, and I'm getting a runtime error with the vector in the data section. class Random { priv...
[1 reply] : > Let me know if more code is necessary. at least provide enough code ... (by ne555)
Dynamic array keeps crashing my program
 
Hi, I'm following the code from http://www.cplusplus.com/doc/tutorial/dynamic/ (at the bottom under the "Operators delete and delete ) to try and make a dynamic...
[2 replies] Last: Thanks for your reply, I'm not really familiar with the virtual keywor... (by aster719)
Vector program
 
I need to write a program that reads 10 integers from the user and stores them in a vector, calculate the average of these 10 numbers and print the numbers in t...
[1 reply] : vector<int> vec; int num; while(cin >> num) vec.push_back(num); Use... (by Boilerplate)
Code prints every number
 
I have written this code that reads 10 integers from the user, stores them in an array, then calculates and prints the average. It is also supposed to print the...
[4 replies] Last: Keskiverto didn't mean line 23, he mean't line 32. He even gave you a ... (by xismn)
second menu not woking
 
I've been trying for a while now using the different ways but I still can't get my 'report' menu to work. Report by Last Name is the first choice, and second...
[1 reply] : Never mind I figured it out. (by JLop0820)
ISO C++
 
I was experimenting with multithreading to try to make this program faster but it does not compile, instead it Dev C++ opens a new window with this error: ...
[10 replies] Last: IdeasMan, I am fixing the code, what do you think? I havn't done ever... (by TheIdeasMan)
Search and replace string in txt file in Dev c++ HELP!
 
My TEXT FILE: test.txt id_1 arfan haider id_2 saleem haider id_3 someone otherone _________________ CODE #include <iostream> #include <fstrea...
[6 replies] Last: still the same errors (by xxdms2k11xx)
Greatest Common Denominator function error
 
How can I make this function display "-1" as the GCD if 0 or a Negative number is entered. I've tried so many ways, but I can not figure this out! Any help is a...
[no replies]
area of triangle
 
So here is my question: The area of an arbitrary triangle can be computed using the formula Area = sqrt( s * (s-a) * (s-b) * (s-c) ) where a, b, and c ...
[9 replies] Last: You can assume that the sides are all integers (and semiperimeter and... (by keskiverto)
Insert Element in Vector for Every certain element
 
I want to add a element such as a space "" inside a vector<string> myvector. For example: myvector +myvector.insert("")+myvector +...+myvector.insert(""...
[4 replies] Last: I was wondering if there is something like this for(size_t i= 1; i<d... (by sadij97)
A quick question about if/else
 
I need help with the following problem. I normally would just type a conditional expression like it states below; but, since I can't format my statement that wa...
[5 replies] Last: "nested statements" means having statements inside of statements (by PBachmann)
"system cannot find the file specified"
 
I have a Mac running VMware Fusion windows 7 Virtual Machine so that I can write my code in Visual Studio. I keep getting prompted with "Unable to start progra...
[no replies]
by Areks
Adjusting the value of one object in a vector based off of the value of another object in a different vector...
 
So I've got one vector with all my citizens and another vector with all my cities. What I would like to happen is to have the population of a settlement be a ...
[no replies]
by sg1997
Help with using SDL platform on C++ Error ?
 
Hello! I'd really appreciate if someone could help me. Im using SDL for the first time and I do not know where I messed up because I followed a tutorial, howeve...
[1 reply] : Disable the precompiled header option in Project Options. (by Moschops)
Project: Need help with calling by reference
 
Hi, I am referencing someone's code given I have a similar project coming up. How would I go about deriving the total ounces at any given time and dealing with ...
[1 reply] : The options are to use by value and by reference. There is also return... (by keskiverto)
Removing and counting vowel, C++
 
->Hello, my program is to get user input and print their sentence into a non vowel sentence while showing the number of vowel in their sentence. It should keep ...
[4 replies] Last: No worries, I really do mind if you use my code. I'll be more than hap... (by capscore)
Multiply diagonals of 2D array
 
Write a program in C++ that stores the following elements in a two dimensional array and prints out the product of all the diagonal elements of the array. Use ...
[2 replies] Last: You've got most of the code for the upper left to lower right diagonal... (by AbstractionAnon)
passing by reference
 
hi guys,how come when passing &x I get an error I thought that since I specified I would be passing in an address of a variable but I get an error invalid conve...
[7 replies] Last: You're welcome! (by MikeyBoy)
unexpected output
 
Hi people,I'm getting an unexpected output when I call this program just for example I add 200 to the bank account then it asks me if I want to enter more I say...
[2 replies] Last: that's strange maybe it's my codeblocks? or something because for some... (by adam2016)
March 2016 Pages: 1... 2021222324... 47
  Archived months: [feb2016] [apr2016]

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