Beginners - November 2012 (Page 24)

push_back a pointer
 
Hi, I wanted to know if there's something wrong with this code: vector<Course*> vec; while(something) { ... Course* c = new Course(); vec.push_back(...
[3 replies] Last: vector<Course*> vec; In this case, an item in the vector - vec - ... (by JLBorges)
Computing the average of positive numbers with arrays
 
why cant i see any output on this code? #include <iostream> using namespace std; double average(int a , int n); int main(void) { int a = {2, 0, -4, -5...
[3 replies] Last: Oh, yeah, you must remove the "else continue" part in the loop, or it ... (by S G H)
by hiken
Bitwise operator
 
hi. Guys, please, can anyone explain to me how the following code works, if you please? int n; char b, l; char s ; cin >> n; gets(s); for(int i =...
[1 reply] : I'm interested in this: cin >> n; What value of n is supposed to be... (by Chervil)
you know usingnamespace std in the global scope is a bad habbit, is it okay to put it in main or other blocks?
 
writing std: all the time is good practice i know but when im just putting something together to see if i learnt correctly its too tempting to just whack using ...
[3 replies] Last: Prefer Using Declarations to Using Directive but prefer full scope... (by closed account z05DSL3A)
by cbegan
Read a file and determine max and min int in file
 
I have some code that reads a file and finds the integer with the max value and the integer with the least value in a file and out puts those values to the scre...
[no replies]
Designing Menu/Including (void) function/Troubleshoot
 
#include <iostream> //HEADERFILE I/O #include <unistd.h> ...
[2 replies] Last: You are missing the while in the do-while loop in game. When you have... (by Peter87)
by Andym
Calculating cylinder Volume
 
Hi all newbie here. I need some help. Can anyone tell me why the following program only gives me a round number for the volume when it is below 1 SQ ft but a ...
[3 replies] Last: The units of volume should be cubic somethings , not square somethin... (by Chervil)
Binary Search tree - In order sorting
 
I have a project where I have given data and I have to insert each using binary search tree technique. My input data format is dd mm yyyy code activity sha...
[2 replies] Last: Finally I figured it out. As I said, the problem was with statements i... (by vichu8888)
1/25 + 2/23 + 3/21 + … + 12/3 + 13/1 =?
 
The source code of this by simple loop 1/25 + 2/23 + 3/21 + … + 12/3 + 13/1 ? what is the errors of this code: #include "stdafx.h" #include...
[2 replies] Last: Special thanks for guidance,it has been solved now. #include "stdaf... (by lvlichael72)
Still stuck
 
Hi , I'm still stuck. I don't know why this is so hard.It's a phone directory program. OptionD function is the issue which is a function that will have the use...
[1 reply] : Put an else on line 30 -- you don't want to increase index after you'v... (by cire)
by carl89
Help with this question using If statement
 
Hi guys, There this question that i cannot figure it out please help me. Q: Write a program that allows the user to enter a score between 0 and 100 and then pr...
[1 reply] : It would look something like this. #include <iostream> using namespa... (by Meden)
Why do I need StdAfx.h?
 
I have a school assignment for C++, and my code is solid but will not compile. We are learning cout, cin, and loops this week, and are creating a simple hello ...
[2 replies] Last: I am using VS 2010 C++, because I can't figure out how to create a new... (by aidenkael)
by Meden
sort with pointer new float[M]
 
// Test Averaging. #include <iostream> #include <stdlib.h> using namespace std; int main(){ float* ScorePointer; int M; float ValueHolder; in...
[5 replies] Last: OMG! Thank you so much! I've been depressed over this problem for da... (by Meden)
Double to Byte
 
Hey guys, Can anyone provide a simple way to convert from a double value to a byte. I need to send a double in a CAN message to a system controller. I am not u...
[9 replies] Last: I had a function that takes in a double and that is where my double co... (by Benjamin00)
C++ Looping Problem
 
ive just started learning C++ at college and ive got this task to which means i have to create a program of how an actual ATM bank works. So far ive come up wi...
[6 replies] Last: @khm3dia I think what devonrevenge is trying to say is use a switch... (by TheIdeasMan)
Class bool equals()
 
Hello everyone, I can't seem to figure out how to see if two of my cards are equal to each other in the lab I'm writing. Here is my code that I have so far. /**...
[6 replies] Last: bool equals (CardType a); { cout<<"running equals"<<endl; if (r... (by Raioner)
Coding an assignment in C.. please help? (1,2)
 
A college offers a course that prepares students for a state exam for real estate brokers. you have been asked to write a program to summarise the result of 1...
[26 replies] Last: I really hope all of this sinks in. How do you recommend I get better ... (by Robl249)
Problem with passing data in classes
 
Hey all I'm having trouble passing my parameters between my classes. Here is my code /*********************** CSC100- Lab 5 Programmer:Zachary Groom *******...
[4 replies] Last: How would I go about creating the equals() method? I made another Card... (by Raioner)
PLEASE HELP ME CHECK THIS SOLUTION
 
I try to solve the problem "While ( user == gullible )", from here http://www.cplusplus.com/forum/articles/12974/ and here is my solution, #include <ios...
[4 replies] Last: lol, hahahahahaha anyway, problem solved, i made it like this #incl... (by geezle86)
typedef unsigned char byte; causes syntax error C2144
 
I am using a library crypto++ in my current program, and whenever I use any of the header files in the library, it throws this syntax error at compile time: 1...
[2 replies] Last: Here you go. #ifndef CRYPTOPP_CONFIG_H #define CRYPTOPP_CONFIG_H //... (by Asif Hirai)
November 2012 Pages: 1... 2223242526... 75
  Archived months: [oct2012] [dec2012]

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