49,757 Topics

Member Avatar for
Member Avatar for new programer

Hello all, I have been trying to use swtich cases in conditions but it won't work what I mean is like this; [COLOR="Red"]do{ cout<<"Enter a valid number"; cin>>number; switch(number) { case 0: bla bla break; case 1: bla bla break; case default: cout<<"re-enter"; } }while(defalut);[/COLOR] if that can never happen …

Member Avatar for new programer
0
80
Member Avatar for bobsta

Hi, I am writing a simple graphics engine using homegeneous coordinates (fourVector) and the corresponding 4matrices (fourMatrix). fourVector.cpp: [CODE]fourVector::fourVector(float x, float y, float z, float w): x(x),y(y),z(z),w(w){ };[/CODE] fourMatrix.h [CODE] class fourMatrix{ public: fourVector i,j,k,l; ... }[/CODE] fourMatrix.cpp: [CODE]fourMatrix::fourMatrix():i(fourVector(1,0,0,0)),j(fourVector(0,1,0,0)),k(fourVector(0,0,1,0)),l(fourVector(0,0,0,1)){} fourMatrix::fourMatrix(fourVector &i, fourVector &j, fourVector &k, fourVector &l): i(i),j(j),k(k),l(l){ } ... …

Member Avatar for MrSpigot
0
97
Member Avatar for transfernly

hi....i am writing a code which reads the contents of file....it has first name, lastname and phone number.....now i want ot read all the first names into one array second into another and phone numbers into third array....i tried but i could read only line by line.....please help out...my code …

Member Avatar for GrubSchumi
0
97
Member Avatar for lovely soso

Write a C++ program that asks the user to enter the length, width, and depth of a swimming pool using getValues( ). calculate the cubic volume using calcCubic( ). Print the result using printCubic( ).

Member Avatar for Divyab
0
88
Member Avatar for Xaenthe

I just know I'm doing something stupid. The part of my assignment I'm working on is to prompt the user to enter the name of a stock, earnings per share, and price to earning ratio, and then display it after everything is entered. What it's doing now is asking for …

Member Avatar for Mouche
0
103
Member Avatar for fahad moosa

sir iam a begineer student and i want to study about c.in turbo c compilers with starting.plz tech me about the function return and pass though function.

Member Avatar for Mouche
-1
94
Member Avatar for joperalez

I know this is using C. But if i was using the stdlib.h to use C in C++, can i somehow save the output into a variable. That way i can save the value for later use. something like... int a = 15; int b = 7; int hexValue = …

Member Avatar for Nick Evan
0
118
Member Avatar for jephthah

I don't understand. Nobody in the US uses this crappy compiler with it's non-standard libraries. No one in the Western World seems to use this. even in second world countries in central and south america, they don't use this. so how is it that Borland seems to have a complete …

Member Avatar for jephthah
2
137
Member Avatar for pri_skit

hii, I am getting "Error Creating bitmap!" in EVC++ 4.0 on Window CE 5.0. I don't where this error came from. I am using CreateCompatibleBitmap and BitBlt for drawing the screen. I have checked all Error codes , but no luck. Description of Error : It’s the SNAP window with …

Member Avatar for Clinton Portis
0
68
Member Avatar for daviddoria

Why people write such cryptic code I will never understand... Can someone explain what is going on in the following: [code] double color = {1,2,3}; double *ptr; // ... assign ptr .... *ptr = *color++; ptr++; [/code] So this line [icode] *ptr = *color++; [/icode] sets the value of the …

Member Avatar for kvprajapati
0
129
Member Avatar for travism

I wrote the following function that takes a string with spaces and replaces the space with an underscore ( _ ). The function works, but I believe there is a less novice way of doing it. Anyone have any suggestions? BTW, this is written in Linux and compiled with G++. …

Member Avatar for travism
0
7K
Member Avatar for dalymiddleboro

Hello guys, I'm brushing back up on C++ it's been a long semester of Assembly Language. Anywho, I am writing a program that keeps track of my grades and can average them up if I need and do many other things. I'm using a switch statement as my menu select. …

Member Avatar for mrnutty
0
115
Member Avatar for lotrsimp12345

Here's what i have. Not sure what it is doing exactly. You pack a account object and then you write it to the buffer right? So shouldn't it print after i write it? Main #include <iostream> #include <iomanip> #include "account.h" #include "Lentext.h" #include "Deltext.h" using namespace std; int main() { …

Member Avatar for Ancient Dragon
0
303
Member Avatar for EngneerNitemare

Hey all, I have this for loop and it keeps printing a '}' at the end of my alphabet and I can't figure out why. Please help me figure out how to get rid of it! :) Thanks! - EngneerNitemare [CODE]// PREPROCESSOR DIRECTIVES #include <iostream> using namespace std ; // …

Member Avatar for mrnutty
0
137
Member Avatar for aitrade

Hi, I have a similar problem. I need to read and store information from a file such as: in int count=7; //count int float end = 7.5 ; //end out float myout =0; //my out I need to store type(e.g. in or out), variable type (e.g. int), variable name (e.g. …

Member Avatar for aitrade
0
74
Member Avatar for sheztc

Hi i'm new to C++ and have made a grading system application. The application works, but I would prefer to use one variable for student name instead of two seperate variables, but when I try to do this it skips to the next line of code when I run the …

Member Avatar for jonsca
0
129
Member Avatar for etsayhaile

amenu driven program using link list data structure,which keeps track of student record of auniversity. the system should maintain at least the following information about student. name year id number DEPARTEMENT age CGPA

Member Avatar for Ancient Dragon
-1
505
Member Avatar for spookyfish

Hopefully this title makes some sense, i wasn't really sure what to put. Hi i need some help with this assignment. Unfortunately, I'm not sure what I've done is anywhere close to what it needs to be. I need to read a list of customer data from a text file …

Member Avatar for Ancient Dragon
0
117
Member Avatar for thanjaa

Hi We have dd command in Unix to make an image of the entire hard disk or a partition of it (bit copy not just a file copy). I would like to know how to do the same in C++. Thanks in advance....

Member Avatar for Ancient Dragon
0
205
Member Avatar for Snapster5

heya, i am working on this program wonderig anyone can help me finish it . i put in most of the //info on whats suppose to happen but am having trouble figuring out actually how to. [CODE] *Program Description: This program is designed to insert numbers into * an array …

Member Avatar for Ancient Dragon
0
158
Member Avatar for BobRoss

Trying to replace '\n' or its decimal equivalent of 10 after it has a decimal value added with its original value of '\n' or 10. This way the newline character won't appear in the ciphertext as some other visible character. [code=c] while (!plainText.eof()){ string plainLine = ""; getline(plainText, plainLine); int …

Member Avatar for BobRoss
0
107
Member Avatar for ukbassman88

This is the last questions I have about arrays. I have no idea of where to go with any of them except writing the header of the functions with the parameters. Again this is just questions from a study guide for my final exam so I am not asking you …

Member Avatar for Lerner
0
131
Member Avatar for ukbassman88

This is another question from my study guide for my final exam. If you all could please give me some help. Write a value returning function called "found" with parameters of a float array a float item and a integer length, that searches the array for any value greater than …

Member Avatar for ukbassman88
0
92
Member Avatar for TylerTCF

Hey Everyone, I have developed a program to help me geocode approximately 100,000 addresses from Google. After doing some i/o to bring all the names into a vector in C++, I have now 100,000 distinct addresses that I must pull up, retrieve the code from google's server via csv output, …

Member Avatar for TylerTCF
0
136
Member Avatar for rena0514

hey i am trying to write a program that allows two users to play tic tac toe....right now i am doing the program in pieces i have accomplished setting up the two dimensional array. i am having a problem changing the * thats in a section of array to an …

Member Avatar for rena0514
0
153
Member Avatar for Snapster5

Hi i put most of the //discriptions in so it should be easy to tell what is suppose tohappen where. It is longer then it seems, its very beginner level. Also im not sure i did the functions and arrays perfect. Errors i have before i have been able to …

Member Avatar for Snapster5
0
144
Member Avatar for UberJoker

Hey guys. I have the following string array, say, string array[2]; array[0] = "hello7925"; array[1] = "bye344539"; I want to read the last two characters from each string in the array, which in this case are 25 and 39 and then put them in a separate array like this.. int …

Member Avatar for UberJoker
0
206
Member Avatar for ukbassman88

I am working on a study guide for my final exam and need help with this question. Thanks in advance for the help. Write a value-returning function called "prod" that has parameters of two int arrays "arr1" and "arr2" of size"length". "Length" is also a parameter. This function should return …

Member Avatar for ukbassman88
-2
98
Member Avatar for fada4ever

include a derive class named sphere from the base circle class. the only additional class members of sphere should be s constructor and a calcval () function that returns the volume of the sphere... please kindly help me in correcting the code.. #include <iostream> #include <cmath> using namespace std; const …

Member Avatar for mrnutty
0
167
Member Avatar for amel036yippee

hello.. i need tips to solve the problem. The situation is like this: I have randomly generated 20 (pop) array of length = board. The output is this: [QUOTE] [B]1 3 6 4 1 4 6 6[/B] 2 0 1 1 1 3 1 3 3 6 3 4 7 …

Member Avatar for amel036yippee
0
128

The End.