Beginners - July 2010 (Page 9)

A easy problem for you guys! about const pointer, with code.
 
#include <iostream> #include <string> #include <vector> using namespace std; /*template <typename aType> inline aType* begin(const vector<aType> &ve...
[3 replies] Last: Yeah. That part is correct. However, since first is: const aType... (by firedraco)
Assist in debugging my c++ mathematical problem
 
Actually I find it difficult solving mathematical problems using c++. I will be grateful if someone can assist debug and correct the mistakes. Here is what I ha...
[4 replies] Last: A more efficient method plus finding error bound. These new functions... (by closed account D80DSL3A)
by Kyon
Char arrays WITH spaces
 
Heya. I decided to make a simple CMD like program today, so I made a very simple String to Char array converter. However, whenever I use it, it returns a char a...
[3 replies] Last: You didn't put a zero terminator at the end of your cstring which is r... (by Galik)
vector as an argument (1,2,3)
 
i know c++ can pass argument by value and by reference and arrays are passed only by reference to a function. what about vectors? passed by ref or val or both?
[57 replies] Last: [quote=xoreaxeax]If you want to modify the passed arguments, you shoul... (by Kyon)
graphics project
 
i have a graphic project by using c++ about clinic system , i searched for simple picture for my interface but i not found any thing , what picture that can i m...
[2 replies] Last: What? (by Return 0)
Book advice for C++ / MS Visual Studio
 
Hey all, I'm after some advice on a good book please. I've read Accelerated C++ by A Koenig and have done some programming of console apps but now I want to...
[3 replies] Last: Thx guys - I've ordered the Beginning Visual C++ 2005 edition for now ... (by h1ddendanger)
Problems with array
 
I have created a program for 'search' in int array..but how do i search against the array such as read 5 student names into the array and display the location o...
[2 replies] Last: Looks like he wants to do a binary search. In order to do that you m... (by kempofighter)
Compilers acting differently.
 
We had an assignment in class: Write a modular program that prompts the user for the total number of students in a class, and creates an array to hold an integ...
[5 replies] Last: More info on variable length arrays -> http://gcc.gnu.org/onlinedocs/g... (by m4ster r0shi)
rotate elements in an array..
 
#include <iostream> using namespace std; void main (){ int x ={1,2,3,4,5,6,7,8,9}; for (int i=0;i<3;i++) { for (int j=0; j<3; j++) { ...
[3 replies] Last: thanks...!! =D (by markjsoria)
by bmop
reassigning values in the game of life!
 
I'm writing code for the game of life, and if the googling I've done is any indicator, you're probably all very familiar with this. I realize this is probably ...
[3 replies] Last: Apologies, I forgot to show you the config.txt file that I'm drawing t... (by bmop)
set of C++ functions
 
Eish guys am honesly don't know where to start, please help! I have write the following set of c++ functions  fromBinaryToDecimal: The function must acc...
[13 replies] Last: Ok thanks and how can you correct me on this function? int DecimalToB... (by Duplaix Lebo)
by Xoric
fstream - combine file modes
 
Hello, I am trying to open a file using an fstream object. - I want to open the file with binary access. - if the file does not exist, I want to create...
[1 reply] : What input do you expect to get from a non existent file? If you need ... (by filipe)
finding the sum of two squares
 
we were given an exercise about finding the sum of two sqaures. i've been having a hard time doing it. i know that the equation for getting the sum of two sqaur...
[1 reply] : Are you sure you're understanding the problem correctly? There is n... (by Disch)
Please look at my code that simulates dice game
 
I'm up to Programming Project 11 in Chapter 3 of Walt Savitch's Absolute C++ book. Could you guys have a look at what I've done and see if it's the best way ...
[7 replies] Last: Improved version: /*The game of Pig is a simple two player dice ... (by gers1978)
Reusing arrays
 
Hello again, are there any co nsiderations when reusing arrays?. By reusing I mean assigning a new set of values after already declaring and using once? Int...
[4 replies] Last: you can copy elements of one data onto other by following way - in... (by Cody39e)
by Xoric
const struct declaration
 
Hi, I am new to C++ and cannot find any information about my question. I have declared a struct and defined two constants of it. struct Bounds { int...
[11 replies] Last: Ok ok.I tried everything methods.But it didn't work.Can u give example... (by Helegurbann)
Case Switching for Pricing
 
I have an assignment, I can't seem to figure how get it going. Basically allows the user to input the amount of pens they want to order and in accordance with...
[3 replies] Last: struct circleType {double price1; double price2; double price3; doubl... (by firedraco)
friend functions and forward class declarations
 
class weapon; // this gives me an error. class character { friend void weapon::addBonus(character*); private: int level, health,...
[5 replies] Last: For character knowing about weapon, that should easily be accessible t... (by firedraco)
Passing variables to functions problem?
 
I've come across pointers and I've moved on to passing pointers to functions. I decided to make my own program related to this so I can understand the concept. ...
[3 replies] Last: Like this: #include<iostream> using namespace std; //reference... (by PiMaster)
How to show the location of error? What's wrong with the program?
 
I am a C++ beginner. And I am a Hong Kong citizen, so my English is not so good. Sorry. 1. How can I show the location of error(s) in an error-existing progr...
[7 replies] Last: I get your point now. #include <iostream.h> #include <stdlib.h> ... (by horace5563333)
July 2010 Pages: 1... 7891011... 31
  Archived months: [jun2010] [aug2010]

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