General C++ Programming - March 2011 (Page 26)

struct like class?
 
I have seen (from the forums) struct's with class like properties. Are structs and classes similar in that they can contain functions and destructors and the s...
[3 replies] Last: Furthermore, it has been suggested to use structs as aggregate types, ... (by thokra)
Need insight to C++
 
I am currently a college student struggling to get my program written for assignments. I want to get better and have a better understanding of C++. It is hard f...
[12 replies] Last: A very interesting and inspiring thread! I have this handy rule: ... (by dutChBZ)
Random numbers and put them at a table
 
hello guys, i need your help at this exercise: i have to write a program which reads random N numbers from the file clocktest.dat (i did it in the previous exe...
[10 replies] Last: Thanks :D (by m4ster r0shi)
by toks
unexpected output :S
 
Hello World, i have the code: #include <stdio.h> int main(void){ int num = 3; int j=1; int flag = 0; for(j=1;j<10;j++){ if(num == 2^j){ f...
[4 replies] Last: oh, Thanks, i was totally stucked. I had used the ^ to be the exponent... (by toks)
function that prints out words and values
 
#include <iostream> #include <cmath> using namespace std; int main() { int years, timesCompounded; //The number of years deposited, the number of times p...
[3 replies] Last: So what happens with the following code when you try to build it? ... (by Moschops)
by elfico
practice problems
 
Hi every one. I have been learning c++ on my own and I think am doing well. But my problem has been that I have not been having a lot of exercises to practice. ...
[4 replies] Last: I think pointers are perfectly accessible. They have technological dis... (by simeonz)
how to make the function wait for some thing to continue
 
Hi, I have a functions like below void Function() { for(int i = 0; i < count; ++i) { if(check_i( int_array ) ) function_gu...
[6 replies] Last: Dont use a loop in your function. Have it do only one step at a time.... (by Caligulaminus)
External compile errors
 
Hi all, I have a problem that just seems to pull my hair out. I have researched the problem with msdn with no solution and your FAQ's solved half of one of th...
[1 reply] : Either you want to compile a library and have forgotten to tell your c... (by thokra)
How do runtime polymorphisms exactly make code flexible at runtime?
 
I am new to programming and have learned that runtime polymorphism makes code flexible. I know that runtime polymorphism avoids code duplication and increases ...
[7 replies] Last: @jackjack Your code snippet actually depicts the whole point of polymo... (by thokra)
Using an Audio API
 
Hi all I'm trying to write an audio program that uses the PortAudio library. I'm having trouble getting a sample program to run in Visual studio express 08. T...
[5 replies] Last: Hi Framework I figured it out. Theres a really good step by step t... (by MCsynth)
Code for Chudnovsky Algorithm [or How to Translate an Equation into C++ Code] (1,2)
 
I was trying to find some code that would calculate an approximation of π, and I discovered a Java applet that uses the Chudnovsky algorithm and runs really fa...
[33 replies] Last: I found the problem. I had declared factorial as int factorial (int ... (by TechnoCat)
Battleship Program: Errors
 
I am getting an error in my battleship program I have not seen before. I am a novice when it comes to debugging my own programs. The error messages I am getting...
[3 replies] Last: It's a 2-dimensional array, correct? So just pass const int** const a... (by Zhuge)
Is my compiler broken? (includes template metaprogramming)
 
Hey all, so I was just recently shown the site, Project Euler and decided to play around with some of the problems. On problem 5 I decided to brute force the...
[3 replies] Last: -_- now I know why they tell you to get a goooood nights sleep. Thanks... (by mackabee)
by toks
printf error
 
Hello friends, i have a code below: #include <sys/types.h> #include <unistd.h> #include <stdlib.h> int main(void){ pid_t h; h = fork(); i...
[6 replies] Last: Did n't notice that line. In that case, you ought to also use cstdlib... (by Zhuge)
by codist
image loader
 
I need to load an image from a file into an array. I would perfer a small snippet of code, but an image loading library would work too.
[10 replies] Last: Thank you all for your help and time! (by codist)
Automatic calculator error
 
I have copied and made a better version of a automatic calculator in another archived forum. I made it so whenever you enter n, a new equation starts. It works ...
[1 reply] : when you enter 'n' on line 24, you then have to enter c on line 25. af... (by hamsterman)
Longest Common Subsequence
 
Witam. #include<cstdio> int n,m,a=0,b,c=1,i,j,C ,I ,J ; char A ,B ,D ; int main(){ scanf("%d",&b); while(c<=b){ scanf("%d ",&n); for(i=...
[2 replies] Last: but what? (by szyfuch)
by fipodk
Assignment of variables
 
Hey, I'm reading data from a file with three columns in three different variables, namely cola, colb, and colc. I need this in order to further analyze the ...
[2 replies] Last: If I write double cola , colb , colc ; I get this error: read.cp... (by fipodk)
Grades (Read and Write) program
 
Hey so I have been working on this program where I am supposed to read and write a file of ten grades and average those ten grades and then write the ten grades...
[3 replies] Last: He means did you put the text file containing the grades in the same f... (by packetpirate)
Check the type of input
 
Hello everyone, can you help me with this? In my program, there are some int and double variables. Here is my problem. When users input a double variable for a...
[3 replies] Last: Use std :: getline (), an std :: istringstream , and eof () http:/... (by Duthomhas)
March 2011 Pages: 1... 2425262728... 31
  Archived months: [feb2011] [apr2011]

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