Beginners - March 2014 (Page 36)

what to return on a struct function
 
Hello, I'm having some trouble with my homework assignment that involves structs. I have the structure here: struct change { change (); int quarters...
[4 replies] Last: I see. I'm not really sure how or where I should define this. I tried ... (by Razor 158)
by adeqze
Wrong looping reading through
 
Hi, I am new to C++. I am just learning. I wrote a program that shows the repeated letters in a string (I also have to count how many times it the letter gets...
[1 reply] : You print out a letter every time you find a repeated one. Since there... (by Zhuge)
While loop issues
 
So this is my first attempt to a while loop and I can't figure it out. The code works just I want it to repeat all of the steps again. All it loops is if i want...
[4 replies] Last: Check and Check that made perfect sense. Thanks for your help. (by MRangel)
Board won't work correctly
 
I'm making a board for a game I am making, and the player won't display or move correctly when I run the program, and I can't find why. using namespace std; ...
[4 replies] Last: When I was testing it, I was just inputting into a variable and then o... (by Jamerack)
text file output problem c++
 
I have a text file template.txt: ********************************************************* To: |1| |2| |3| |4| |5|, |6| |7| Dear |1| |3|: You and the |3|...
[no replies]
by wolfv
getline() breaks fstream?
 
The following code appends text to the end of tests.txt file as expected. But when I uncomment the while loop (lines 27-30), nothing is appended to tests.txt. I...
[2 replies] Last: Thanks long double main! testsFile.clear(); fixed it. (by wolfv)
by acorn
difference between these functions and const correctness
 
I know that a const variable cant be changed. I also understand that a const reference as a function argument cant be changed. what im confused with is func...
[1 reply] : In the case of these return values, there is no difference since you a... (by Zhuge)
bad alloc error when reading from a file
 
Hi all, So I am working on a program for my class and running into "bad alloc" whenever I try to run my code. I get the error at the same point at the end of t...
[2 replies] Last: Thanks a lot for the help! So now it runs all the way through without ... (by dshoe19)
by ray88
keep getting errortrying read from a file and send data to a file
 
Im reading in an array of struct from a file and sorting by order date then calculating the sale amount for each item (quantity*price) then calling a max functi...
[1 reply] : http://www.cplusplus.com/forum/articles/40071/#msg216270 In general co... (by ne555)
Help with code?
 
I was just testing a few functions to make a battleship game, but I keep getting this error: client.cpp:22:29: error: expected ')' void printBoard(char a...
[5 replies] Last: I am coding on a Mac with an app called CodeRunner, a text editor with... (by heyyouyesyouiloveyou)
help with initializing variables and system(pause), system(cls)
 
I'm writing a program for school to calculate the monthly payment of a mortgage for 15, 30, or 40 years. I keep getting the error message that some of my variab...
[5 replies] Last: Thank you catfish! I didn't even notice I put downAmt in another calcu... (by greenlovinggirl)
by Mtt20
validate the text as a double data type and convert the string to that double.
 
I need to validate the text as a double data type. After trying to run the program I wrote , Dev is giving me an error at shown location **** on code. I feel ...
[7 replies] Last: At this point this is what I have..... but I when running it I can not... (by Mtt20)
Text Manipulation
 
Hi, and thanks for any help you can offer in advance! I'm very new to C++ and coding in general, and I'm having trouble figuring out what is wrong with this pro...
[no replies]
convert string to dec ascii number
 
Hi am trying to convert a string to integers ascii dec equivalents by storing it into int arr . For some reason by calling it, it is only printing -52 as all th...
[1 reply] : You don't ever assign to arr1, so arr gets garbage values. Did you per... (by Zhuge)
PLease I need help (knowledge of switches and functions)
 
The message log keeps telling me that I am incorrectly using the switch statements. it says that I have incorrect breaks and cases. I don't' think so and so I ...
[1 reply] : main.cpp: In function 'int MathOp_C(int)': main.cpp:34:21: warning: s... (by long double main)
Is an Array a Container?
 
(nooby question) Is an array a container? I presume yes as it holds objects but in my book it says vector is a container type. but it does not say array. So.....
[2 replies] Last: K thank you (by closed account EwCjE3v7)
Prime or not?
 
So I've finished a code but when I submitted it to the grading program, it says this: cc1plus: warnings being treated as errors Primenum.cpp: In functio...
[10 replies] Last: Yeap, 2 is a prime number. And in your loop you could test just until ... (by Hiten)
by r3wt
Basics of Building a website in C++ with POCO or CSP
 
I learned php a few months ago, built a high volume trading application. two weeks ago, it was hacked. for a while i've been feeling discouraged, but i've reali...
[3 replies] Last: coder777, you're my hero. Witty sounds amazing, particularly since it ... (by r3wt)
Performance time for quickort
 
hi i need to write a program that sort a vector of random numbers with quicksort and need to know the time in seconds. i know i can do something like cloc...
[1 reply] : Create a function that will do the timing for you: template <typenam... (by Smac89)
error in my function not sure
 
For this function I am supposed to call my like this but for some reason this error keep coming up "redefinition of formal parameter 'size'. (If your wondering ...
[2 replies] Last: Thanks I figured it out :) (by hunterx893)
March 2014 Pages: 1... 3435363738... 79
  Archived months: [feb2014] [apr2014]

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