Beginners - November 2013 (Page 49)

Changing element of vector does not persist or does iteration make a copy
 
I a noob, so I apologize in advance. :) Based on the following code: std::vector<std::string> v1; v1.push_back("bbbb"); v1.push_back("cccc"); for(std::...
[7 replies] Last: References to the rescue! std::string& word = *iter; (by Duthomhas)
by Runic
[Error] 'else' without a previous 'if'
 
It says that the else on line 53 isn't connected to an if. I am not sure what exactly it wants me to do here. #include <iostream> using namespace std; i...
[11 replies] Last: Wait, never mind, that actually does work! I was entering N as a numbe... (by Runic)
What are the 80/20 fundamentals I should learn?
 
I have tried learning C++ in the past and have always failed because it was so overwhelming. I recall when I tried in the past, I would frequently run into mult...
[2 replies] Last: I would recommend starting by reading up on variables, arrays, loops, ... (by CplusplusAcolyte)
by rvrst
RPS code
 
I'm not entirely sure how I would go about using the results i get in my winner function in other functions i.e. outputting into a file, displaying results in p...
[4 replies] Last: Gotcha, thanks. I have just two more questions. When in event of a t... (by rvrst)
Trouble W/ Floating Point Random Numbers
 
Writing a code to simulate windspeed in intervals of 10s over an hour and print info to file named "wind.txt" Decided to use a float random number generator to...
[4 replies] Last: I can't seem to understand why, especially why the interval is so wac... (by Catfish666)
Help With Pointer Arithmatic
 
I'm trying to get a program to run here that will fill a dynamic array of class objects using pointers. From what I can tell from the errors (Unhandled exceptio...
[13 replies] Last: But on a more positive note, that works perfectly now, so cheers! N... (by Catfish666)
by Ariamn
average count
 
Hello, want to write a code with average count. program is supposed to count the average number, then put out the numbers that are below the average number....
[2 replies] Last: Hi Ariamn, I updated your code and it should work fine: #include <io... (by Shadowcool39)
error C1075: end of file found before the left parenthesis '(' at ...
 
Hello :) When compiling a code, I received this error : " error C1075: end of file found before the left parenthesis '(' at 'c:\users\user\documents\visual stu...
[4 replies] Last: pff...thanks. i am really tired,i thought that line 282 is the last li... (by Guzfraba)
Help me find errors
 
so following program counts and prints meanings of b and http://imageshack.us/photo/my-images/545/4ekz.jpg/ and I have to find errors and mistakes in the ...
[3 replies] Last: thank you so much! (by waspzero)
Passing c-strings as pointers
 
I'm rewriting a program for an assignment in my c++ class where we need to change a c-string array which gets a line of text and then counts a user-inputted let...
[3 replies] Last: void getText(char *pText) // <- pText is a char* (a pointer) { cou... (by Disch)
Is it ok to mix cstrings and strings?
 
Hi, I wroted a function to check if a string is a palindrome, I first used cstrings so I can create a double pointer which I can move along each character and m...
[9 replies] Last: All of the above. Pointer arithmetic is extremely error prone, which ... (by Disch)
simple while loop help
 
I need to create a code that will output a loan schedule based on these three inputs from the user: For example.. Please enter the balance on your loan: $10...
[2 replies] Last: @Manga, you are correct that the math is suspicious, but the 9% intere... (by CplusplusAcolyte)
Command line arguments with make.
 
I have to input a file name on the command line for the make and I do not understand how to do this. I've tried looking it up but got confused with something li...
[no replies]
by dcradu
reading multiple text file, char
 
hi. I need to read text from a file that is written on multiple rows. The problem has more requirements and I have done them buy they didn't work and I'm sure i...
[3 replies] Last: thanks very much both of you :D (by dcradu)
This should work??
 
I've been trying to figure this out for a couple days now. I don't understand why this doesn't work. Somehow the Ai while loop causes it not to show moves. I to...
[1 reply] : the problem I think is with your while loops and line 23... remembe... (by Manga)
by Mayah
Outputting simple statistics based on an array
 
Hi! Everything works well with this program except from the calculations of the sum, count (countTotalValues which always outputs 101), average and variance....
[6 replies] Last: You've been most helpful, giblit! I truly appreciate it! :) Thanks for... (by Mayah)
by enemy
strchr
 
Please, what is wrong here: #include<iostream> #include<string.h> using namespace std; int main(){ int field ={2,6,4,7,5,4}; int a=strchr(field, ...
[2 replies] Last: #include <iostream> #include <string> int main() { std::string f... (by cire)
Need help creating a program that outputs and counts the vowels in a sentence.
 
I have been stuck on this program for almost a week and cant seem to find out what's wrong with it. I would appreciate it if you helped me with my code and not ...
[4 replies] Last: Ah sorry for some reason I was thinking that getilne appended the null... (by giblit)
by tang
how to change it??>Parking charge given is from 6am to 6pm. If after 6pm until 6am, per entry parking charges is RM 6.00.
 
#include <iostream> using namespace std; int main () { int hours,charges,total,vehicles; int first = 3; int second = 2; int subsequent = 1; total = 0 ; ...
[7 replies] Last: Suggestion 1 is explained here: http://www.cplusplus.com/forum/article... (by keskiverto)
by enemy
why is z not simply 30 here?
 
Why is z not simply 30 here? // more than one returning value #include <iostream> using namespace std; void prevnext (int x, int& prev, int next) { ...
[5 replies] Last: but z is ment to be 30 then, It's not. You never set it to 30 (or ... (by Disch)
November 2013 Pages: 1... 4748495051... 80
  Archived months: [oct2013] [dec2013]

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