Beginners - February 2014 (Page 11)

Sum of Multiples of 3 (Recursion)
 
I'm lost on this recursion stuff. It seems like a simple concept yet I cannot grasp it. So what I'm supposed to do is sum up the multiples of 3 in a given numbe...
[1 reply] : You are not even using the modulos operator, so I have no idea how you... (by Smac89)
by fi50
Call to Tree Insertion Function
 
Hey I've been looking at some example code for a recursive function that inserts an element into a binary search tree. It's a relatively simple function that t...
[1 reply] : This could help you to start. node* insert(node* p_tree, int va... (by cronopio)
function in cpp file for .h doesn't get recognized in cpp file for the main()
 
Below is an excerpt from the Car.cpp for Car.h #include "Car.h" // Class Definition file #include <stdio.h> #include "stdafx.h" #include <string.h> ...
[4 replies] Last: I found the answer. I need to clone a class. like Car CCar; CCar.dis... (by SangHan)
Ternary operator
 
I was given this block of code and I don't really understand it. I was told it's the same as an If Else statement. Could someone write this as an If Else statem...
[3 replies] Last: Look the website... http://www.cprogramming.com/reference/operators/t... (by cronopio)
by chofs
scientific notation problem
 
Write your question here. hey guys I have slight problem in my scientific notation output my exponent is displaying 3digits and I want it to display 2 digits ...
[2 replies] Last: Try using the printf function.... ... float x = 4.5695; ... (by cronopio)
loop and error handling
 
hi i am new to c++. please help. i am trying to use a while loop to display a menu system. my code works but i need help with error handling. how do i go abo...
[11 replies] Last: No worries mate hope it helps. I'm sure we all know how it feels when ... (by RabMac)
print to screen vector
 
I have read in a file called thickness.txt and assigned the columns of the file as vectors (latitudes_iso, longitudes_iso, depth_iso). I want to check that all ...
[1 reply] : You can simply use an instruction of repetition, looping through each ... (by cronopio)
3 files (Car.h, Car.cpp, automobile.cpp), is variable declared in .h file accessible in both cpp files?
 
I have three files and I declared a variable in .h file but my cpp file where main() resides can't recognize this variable. Why? below is from Car.h file: ...
[3 replies] Last: Thanks everyone who posted. I got it now. :) (by SangHan)
How to make a custom window.
 
haw can I make a basic window in c++? I didn't find any tutorials. I learned c++ from a book called sams teach yourself c++ in 24 hours. here is a link for it--...
[18 replies] Last: I like the blender game engine. Check out this demo game. http://ww... (by Manga)
by chofs
taylor series swaping signs problem
 
hey guys am trying to compute a sinx taylor series but am unable to swap the + - signs in the sequence....my code is only adding...here is the sequence sinx=x-x...
[3 replies] Last: int sign = -1; for(int i=1;i<=8;i +=2 ) { sign *= -1; total +... (by giblit)
Shuffling array while keeping links/ordering within array
 
Hi all, I want to randomly shuffle an array but also keep some physical links together/in order. If I have an array like {10, 20, 50, 1, 2, 3, 15, 25}, I ...
[no replies]
reading from cin buffer
 
This is just an at home assignment so i can expand my knowledge of C++. what i am trying to do is write a series of numbers in console then print out how many p...
[2 replies] Last: nice, very cleaver thank you (by bigapewhat)
Calling functions
 
Thanks in advance for any help...very new to c++. I am having a problem calling a function. the code below is incomplete but the part i am working on is cal...
[1 reply] : Line 101 int findLargest(int& f, int& s); should be int num = findL... (by Yanson)
by BaneX
Need help writing an algorithm
 
I'm a beginner to computer programming. Although it may seem like I'm asking the answers for my hw, alll I really need is some help and guidance to help me get ...
[no replies]
by howto
returning pointers from an array of structs
 
Hi, I am trying to make an array of structs that are able to change size at runtime according to user input. When I run the program it stalls and I don't kn...
[no replies]
by icu2r1
catalogue programming assignment using structs and arrays
 
Hi! I need some help on my assignment. My main problem right now is I cant get my function getPrice() to work. My assignment says I need to use an array i my st...
[no replies]
by RabMac
Converting between c++ and c#
 
Hi, I have just made a program in C++ that deals with bank accounts but I have now been told that I need to write it in C#. Anyway I was wondering how eas...
[3 replies] Last: //Function selects correct switch case based on user's menu choice v... (by RabMac)
by mabbia
readin newline \n from file
 
i am making a program of calculating frequency of each word in a text file..which i have done successfully.but i also want to calculate no.of newlines in text.....
[4 replies] Last: i am using strtok in order to tokenize my text in words...my words are... (by mabbia)
Stack Overflow?
 
For some reason I'm getting a stack overflow with this code. I've done a little C++ before in school but have just recently gotten back into it for my work. I'v...
[4 replies] Last: Thanks......I never even thought of that! works like a charm. -Tyler... (by EverGreen1231)
February 2014 Pages: 1... 910111213... 60
  Archived months: [jan2014] [mar2014]

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