Beginners - April 2010 (Page 34)

by gcr114
Not all control paths return a value
 
Problem: Create a program that will calculate the volume and surface area of a cylinder using the radius and height. Your program should contain a main functi...
[1 reply] : The function doesn't do what it's supposed to. Keep trying. Tip: Its ... (by helios)
Program .. Urgent!!! (1,2)
 
hello here is the program download: http://cpe.kuniv.edu/users/alharbi/eng200/index.files/hw3_2.exe to see the program that you have to build. Make sure to ...
[24 replies] Last: I was kidding. 8^D This site needs some emoticons. 8^p (by cnoeval)
Why is the pointer not pointing? (1,2)
 
So, I'm trying to open (or create for the output files) 4 files to use in this payroll program I was assigned. The thing will compile, but when I run, filena...
[20 replies] Last: When properly used, std::string has no more overhead than doing the al... (by helios)
Is there a way of making a base object return a derived object?
 
class A{ public: A *Get(){ return this; } }; class B : public A{}; Where I would have an object B, call Get() and have it return B rather than A...
[5 replies] Last: It probably is poor design on my part, I don't know how to do it bette... (by AlwaysLearning)
Where is my wrong
 
#include<iostream> using namespace std; #include<cstring> #include<string> #include<conio.h> using namespace std; typedef struct number{ char sig...
[4 replies] Last: thank y so much (by vampire)
Argv[] to Hex
 
I am trying to figure out how to take in argv as a hex value. An example would be - ./myprogam abcdef123456 I need the value of abcdef123456 to be a hex ...
[1 reply] : Use stringstreams and manipulators (by Bazzy)
Unicode
 
Hi everybody! I must read from unicode-file some text by ANSI C (NO C++). Yeah, I have found some algoritm from this site, but it doesn't work. wchar_t stri...
[4 replies] Last: No, it doesn't work. I've got a black screen and row: Press anykey to ... (by Dmitrij)
constructor calls in vectors
 
Hello, good people. I was thinking, is there a way to push to vector while calling a custom constructor? class amm { public: amm::amm(void); ...
[2 replies] Last: You shouldn't have the class scope specifier inside the class itself. ... (by Bazzy)
by AyJay
Difficulty in compiling a C programme on a C++ compiler
 
Hello, can someone point out where I am going wrong please? My understanding of C is a bit rusty and C++ is a non-starter (did Visual C++ in an evening class ye...
[3 replies] Last: Hey AyJay, I'll attempt to answer your questions, but I'll say up f... (by sammy34)
Undeclared variable
 
# include "header.h" Saving :: Saving(char *N , double ir) : Account(Name,balance) { N = new char (strlen(Name)+1) ; strcpy(N,Name) ; interestRate =...
[4 replies] Last: I see... Thanks (by DoomCarnage)
cannot compile
 
#include<iostream> using namespace std; class HowEasy { string ch ; int i; int count; public: int pointVal(string text) { ch = text; i=0; ...
[3 replies] Last: Okay there's a bunch of problems here. 1. ch = text; In this ... (by closed account jwC5fSEw)
by SoloXX
Why isn't my IF/ELSE statement working?
 
Hi, I am in a beginner's C++ class and I am having a bit of trouble understanding my if/then statement doesn't work. It's a simple console app and I've used ...
[3 replies] Last: When you say it doesn't work you mean that you can't see the output? I... (by m4ster r0shi)
Remove zeros from array
 
I want to remove all the elements that are zero from an integer array. If I understand correctly that is "impossible" to do on the original array since it MUST ...
[5 replies] Last: You can use two dynamic array to do that thing. But in your code,i us... (by qtpan)
funtions in arrays
 
hey guys i gt this prac for campus plsss help here the question: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ You are going to write t...
[3 replies] Last: hey guys ok i need help to shuffle the array...it says to shuffle the ... (by blaze745)
expecting ';' before ')' token, all variables defined
 
i have this utterly simple for loop: for(i, i<t, i++) { tmp = a + b; a = b; b = tmp; } all the in...
[4 replies] Last: ^^ (by m4ster r0shi)
how to limit the insertion times to this prog
 
I want to allow the user to input only three values to this program after that I want the program to exit. please help. #include <stdio.h> #include <stdl...
[2 replies] Last: thank u mate. (by malhajri2006)
formatting phone numbers
 
I am prompting the user for a phone number in my program. The problem is is you never know how the user will input the number. Is there a way to check the input...
[1 reply] : I suppose that since a phone number is meaningful if seen as a sequenc... (by m4ster r0shi)
[update:post: 10] displaying 0s, leading zeros?
 
EDIT: I realized that if I type in 1000 the result would be 1,0 because of the modulus divsion. So do I convert the numbers into strings in order to solve t...
[11 replies] Last: thx imi for the help, finally got it to work #include <cstdl... (by paulliwali)
Understanding programming question
 
using strncpy and strncar functions: void safe_concat(cnst char a , const char b , char result , int result_maxlength) implement a function that concate...
[1 reply] : It doesn't sound like you need to accept any input from the user. You ... (by sammy34)
by tysonc
for loop not working correctly
 
This is a for loop (with a couple others nested inside) I'm using to output some averages for the following input file. But for some reason the main loop doesn...
[10 replies] Last: I'll try it out... if it doesn't work I'll figure something out, it's ... (by tysonc)
April 2010 Pages: 1... 32333435
  Archived months: [mar2010] [may2010]

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