49,761 Topics
| |
Can somebody help me with this? You are burning some music CDs for a party. You've arranged a list of songs in the order in which you want to play them. However, you would like to maximize your use of space on the CD, which holds 80 minutes of music. … | |
Modify your week 5 assignment to include a function for both A and B. The function for A should have the quantity of numbers passed in as a parameter and needs to return the largest number. The function for B should have no parameters and return the smallest number. Here … | |
Im having a very strange problem that I can't explain =/ this is what the compiler is saying: 1>------ Build started: Project: 3d, Configuration: Debug Win32 ------ 1>Compiling... 1>RENDER.CPP 1>Generating Code... 1>Compiling... 1>GEOM.CPP 1>MAIN.CPP 1>MOVEMENT.CPP 1>Generating Code... 1>Linking... 1>MAIN.obj : error LNK2005: "struct OBJECT * obj" (?obj@@3PAUOBJECT@@A) already defined in … | |
Dear Folks, I have a fairly complex problem at hand. I need to be able to define various class hierarchies, which are causing me a lot of trouble. I wanted to know a few of C++ features to clear out my confusions. Firstly, lets us suppose we I need to … | |
5. Write a program that adds up the squares and adds up the cubes of integers from 1 to N, where N is entered by the user: Upper Limit: 5 The sum of Squares is 55 The sum of Cubes is 225 Do this by using just one loop that … | |
[code] #include<iostream> #include<conio.h> #include<string> using namespace std; int main() { int i,len,t; cin>>t; char a[100],b[100]; while(t>0) { cin>>a; len=strlen(a);len=len-1; for(i=0;i<=len;i++) { b[i]=a[len-i]; } cout<<"value of a\n"<<a<<"\n"<<b; if(strcmp(a,b)==0) cout<<"YES"<<endl; else cout<<"NO"<<endl; t--; } getch(); return 0; } [/code] every time the loop runs the garbage value of char b; remains. . … | |
Hello, I have been lurking on this site for a while, reading other people's programming questions and answers in the hopes that I'll learn something. I'm in my first programming class right now, and I think I'm confused about nested loops and how to keep a program looping until it's … | |
I'm having some trouble with my while loop in my code. If I enter in 20 and then enter in 14 for the coupons I want to redeem, it goes into a constant loop and doesn't stop. However I did stop it from doing this by putting in a [icode]break;[/icode]. … | |
My program should find any 4 letter words and change them into string "love" ... i have successfully found all the spaces and modified any 4 letter words before the spaces... however, the last word before the '/0' doesn't change... please help. btw, is there any string class function check … | |
Hi Guys, I'm trying to write a program (MFC) that while working displays a log to the user. For this log I thought I'd use an Edit Box because I can set it to be "multiline". What I had in mind is to display each new log entry in a … | |
Hi, Can we use structures within classes as data type? if yes then please give some examples? Thanks | |
How would I write a function with an undefined number of arguments? Like, how when using printf(), you write the string in the first argument and in the string use format identifiers. Then, for each format identifier you use is an argument specifying what should be put there in the … | |
Hi, I have been trying to figure this out and I know it must be something simple but I cant get it. Why does the following code give an answer of 1. double a=8; cout<<pow(a,1/3); I would think it should be 2. Thanks | |
hello, i need some help. i have an assignment that i need someone's opinion on. this is what the assignment is about: A soft-drink manufacturer produces several flavors of drink—for example, cola, orange, and lemon. Additionally, each flavor has several versions such as regular, diet, and caffeine-free. The manufacturer operates … | |
Hey everyone, I need help with my program it is an ipod simulator that goes like this: [CODE]/* FUNCTION - void initaPod Initialize all the slots to blank and 0 size memory*/ void initaPod (); /* FUNCTION - int addSong attempts to add a new song to the aPod returns … | |
hello everyone.. thx for droppin' i need to write a program, a recursive sudoku solver and this is what i have so far... [B]main.cpp[/B] [icode] #include <iostream> #include <vector> #include "sudoku.h" using namespace std; int main() { vector< vector<char> > rows; // Load grid rows=load(); // Check if grid is … | |
Please anyone help me on classes. I have written this class example and keep getting error on that the function is private. I though variables in functions are private but mmh, I think I'm wrong. Can anyone clarify how to rectify this? Also, could you explain to this New Bee … | |
Hello! here c++ program. my problem is i need to find the permutation is even and odd. However the value +1 (even )and -1(odd) is not appear for each permutation. [code=cplusplus]= #include <stdio.h> #include <stdlib.h> #include <iostream> #include <memory.h> #define MAX 100 char num[MAX + 1]; int n; using namespace … | |
First of all hi to evryone. I tryed to make a exe work on most pc's but it only works on mine. My friends got a error when they try to run it. "The application cannot be started because the configuration of the application is wrong. ( or something like … | |
hey, i am working on this project, and have made it to the end of the hard coding part. Now i need to work out the bugs / get the thing to compile. I am having some trouble though as i am getting error messages that i dont understand. here … | |
How can I read integer by ifstream from a file 2 3 -5 9 -6 Besides, how can I read the negative sign also? Thanks everyone!! | |
Hi, I m trying create a COM Server EXE(C#) from my VC++(dll). The problem is when my dll is in Admin privilege and when i try to do a CreateInstance of my C# EXE it's created with same privilege(admin). I m trying to figure out how to Create my COM … | |
So I got past my last problem using new[], but now I seem to have a new one... I created a char***, var. The goal was to build each dimension of the array to be different sizes at different times, based on separate user input... Here is the code: [code=cpp] … | |
Well people... I already know that c++ is not what I want to do in the future, but I do have to pass this class. That said, I need help with this array. I understand how they work, but my instructor wants us to use them in a function!!!!! I … | |
Hi, I'm having issues with a program that concept-wise sounds very simple. The program should read in data from a text file (attached a2.txt), and perform stack and queue operations upon the data. The data consists of long math problems, dealing with order-of-operations. The correct output that should be appearing … | |
I have a few assignments to get done, but I figured I'll post one to see if I'm the right track. If so then what I did will greatly help me. Here are the requirements [quote]Create a simple Dog class that has the following private fields (age (int), gender(char), name(string), … | |
Hello, I have a problem (error) the error is : [QUOTE]a.c:354: error: ‘hton1’ was not declared in this scope [/QUOTE] and the code is : [url]http://wklej.org/id/52405/[/url] What is wrong ?? | |
I have been giving the task of making a box using all asterisks, given an input of say 5. Im supposed to make something that resembles a 5x5 box with nothing in between... I am stuck at a dead-end here and any help would be appreciated! My code so far … | |
I just have one question, when you have a class that is defined: [code=C++] class box{ public: int *value; box() { value=new int; *value=0; }; box(box &c) {*value=*c.value;}; }; [/code] If in the main you said class box b(a); it would work as expected. But I don't understand how that … | |
Ok, I know how to overload an operator. I have successfully overloaded +, -,=, * for a matrix class. I am trying to do inversion of a matrix. I have the code working for the inversion but I do not know how to properly overload the function I want. I … |
The End.