Beginners - June 2010

prob making class template
 
I can't figure out how to make a class template out of a class that i have already defined. Could someone explain to me how templates are implemented? My class ...
[9 replies] Last: If you really want to learn C++ and how templates work you'd be better... (by kempofighter)
simple string concat
 
Hi, I want to put a clock timer into a filename of a file I'm opening, but I can't figure out how. Something like this: //get clock time for filename c...
[5 replies] Last: thanks, it worked! (by timfoea)
structure
 
i have a problem with structure size.this is my structure : struct bmpFileHeader{ char bm ; long int fileSize; short int reserved1; short int reserved...
[9 replies] Last: For a more complicated but more object oriented solution see these lin... (by kempofighter)
Random Array of Strings
 
#include <iostream> #include <string> #include <ctime> #include <cstdlib> using namespace std; string random = {"one", "two", "three","four","five","s...
[8 replies] Last: Array indexes are zero based, not one based so I am not sure where you... (by kempofighter)
by fafner
Repeating char array
 
I'm writing a program in which the user enters text into a char array. I then need to "extend" that text, so that the text is repeated over and over again until...
[2 replies] Last: Awesome, thanks;) (by fafner)
Problem with binary files
 
2 binary files f1 and f2,which components are symbol strings.Components are in alphabetical order. Have to merge f1 and f2 into f3. F3 components have to be in ...
[1 reply] : The sorting code you have will only work if then eng_dict.txt file is ... (by Disch)
Compilation Error
 
Hi, I am getting compilation error in this code, i am unable to find, what's wrong. kindly help. Compilation error is 7.cpp:36: error: expected ‘;’ ...
[6 replies] Last: +1 Galik (by closed account z05DSL3A)
by amma
run application from another application
 
Say we have two main files generating two programs p1 and p2. how can a third program call p1 or p2, which are already compiled?
[4 replies] Last: Ok, thanks for the explanation :) (by kaduuk)
overloading the '>>' operator cause error.
 
Hi there everyone. Nearly finished going through the "C++ A beginners guide" by Herbert Schildt. In Chapter 11 it talks about overloading the << and >> op...
[2 replies] Last: Yup see that now!! Bascially I original had some arguements within ... (by Tset Tsyung)
by kaduuk
Problem with setprecision
 
Hey guys, I've made a code: //code code cout<<"\nBefore we start, to how many numbers should the result be rounded? "; int round; cin >> roun...
[2 replies] Last: I know that using system is bad, however, this is just a temporary sol... (by kaduuk)
by Sorcus
Boost runtime error trying to access multi arrays
 
Hi all, I am trying to create a magnetic field AR game application. The magnetic field data is fed into a 3D array from a file and I try to manipulate the 3D...
[no replies]
by sendjy
child class not inheriting access to private data area to another class
 
I implemented a orderedList class, which i defined to be a subclass of the list class. This way i only needed to define the add method. But the problem is th...
[1 reply] : This feels wierd because i thought that all subclasses of a class sho... (by Disch)
by EEmsu
operator will not divide?
 
Hello, Im not sure why but when I run my program using v=4/3*PI*pow(r,3); the output appears to disregard the "4/3", but if I use v=1.333333333*PI*pow?(r,3); i...
[2 replies] Last: Thanks for the help! (by EEmsu)
Length of String
 
When I am using the sizeof(string_name) whatever I input, the value turns to be 4.When I include the string header file, strlen(string_name) is reported undecla...
[1 reply] : sizeof is to determine the size of a structure in memory. strlen is t... (by Athar)
Need some guidance.
 
First off - I'm completely new to C++. I have gone over the basics etc. I have a problem i would like to try and solve using C++ which is : Rest assured thi...
[2 replies] Last: Thanks for the good info athar ; ) specially the packet sniffer (by jmoore2020)
Controlling user input
 
I am teaching myself C++ to help with upcoming classes that I will be taking at Uni. I am trying to come up with a way to make the program throw an error messa...
[3 replies] Last: The in_avail () function is not required to return useful information... (by Duthomhas)
What to do if no "cin" is entered
 
I'm working on a program which is supposed to read a series of numbers from the user and calculate the mean and range. When there is no input, it is supposed t...
[2 replies] Last: Thanks so much for your help! I (obviously) had no idea what to put f... (by slg5094)
beginner loop problems...i think
 
so, I got this assignment: Write a program that calculates the amount a person would earn over a period of time if his or her salary were one penny the first...
[4 replies] Last: Something you can use as inspiration: int currentSalary=1,totalSal... (by Athar)
by ymabob
Return 0; Vs. Return (0);
 
Hi everyone, I'm an absolute beginner when it comes to C++, or any other programming language for that matter. I only just started yesterday and I've been readi...
[2 replies] Last: Ok thanks a lot. It's good to know. (by ymabob)
finding greatest common denominator
 
The exercise in the book I'm reading wants you to take a fraction and bring it to lowest terms. A few minutes ago I actually had a fair sized post asking for h...
[1 reply] : wikipedia gives several far more efficient (and simple) algorithms for... (by jsmith)
June 2010 Pages: 123... 26
  Archived months: [may2010] [jul2010]

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