49,757 Topics
| |
Please help me, The question is: "Write a program to accomadate 10 integers. Print the variables at position 3,5 and 2 respectively." thank you! | |
Look at the following code... [CODE=cpp]#include <iostream> #include <cstring> using namespace std; class string { char *p; int len; public: string(char *); void show() { cout<<p<<endl; } }; string :: string(char *p) { len = strlen(p); this.p = new char[len+1]; strcpy(this.p, p); } int main() { string s1, s2; char … | |
please help me wright this program[code]use for loop to construct a program that displays a pyramid of x it should be 20 lines high[/code] | |
Hey, I'm confused... Are Static references the same as Static variables? Thanks | |
I am writing a fake banking program. In the function below I declare a dynamic array. [CODE]void trArr(int transactions) { int n; string* accUse = new string[transactions]; return; }[/CODE] I try to access the array in a later function but I get the error "not declared at this scope. I … | |
Hi everyone, I'm trying to compare list iterators: [code=c++] list<int> l; list<int>::iterator lb = l.begin(); list<int>::iterator le = l.end(); if (lb < le) //here I'm getting error - no operator match these operands: { //do something } [/code] And when I change this that instead of list I have vector … | |
Hi I think this is my first post, so here it goes: [B]Overview:[/B] [INDENT] This program declares global bidimensional array of 30 rows and 5 columns (not counting 0 in the rows) of floating type to save information of students, table is as follows: ID Partial1 Partial2 Partial3 Partial4 Average … | |
Well I'm relatively new to the forums and to C++. I'd like to overload + and = to add two matrices by being able to use Z=X+Y format. Header file: [CODE] #ifndef HOMEWORK1_H #define HOMEWORK1_H class Matrix{ public: double **element; Matrix(int=3,int=3); ~Matrix(); double getelement(int,int); void setelement(int, int,double); Matrix & operator+(const … | |
I'm new to visual studio 2008. I'm trying to make another form be called by the first form by a button. Where and how do I create an instance of the 2nd form? I'm working with a CLR (Windows Forms Application). Please and thank you. | |
I am taking an intro to cs class. I have written a simple program but dont know if it is correct. please help me. thank you! | |
Hi! We can declare not just variables but functions or pointer to functions also in the main function like this: double my_f(double); double (*my_fp)(double); But what can we do with this? For example how can we give a value for my_f or my_fp? I try lots of variants with * … | |
can someone please explain to me how read write work in sock programming. my assignment is to run a server and client. the client ask the server "who are you?" and the server replies with the servers name and date and time. i cannot post my whole code here as … | |
Hi I have written a program in c++ and I feel that it is a bit slow for very large datasets like > 1GB. Well I am not that confident in char* since I have just started coding in c++. So can anybody help me to make it more efficient … | |
I have a project that consist of 10 forms. When I compile this project I get this compile error. [I]1>Form6.obj : error LNK2011: precompiled object not linked in; image may not run 1>LINK : fatal error LNK1104: cannot open file '.\Debug\Form6.obj'[/I] In the debugfolder I can find these anyway but … | |
I am new to programming, but I am trying to create two arrays, arrX and arrY. Then use scanf to insert intialnum amount of elements into each array. That is the easy part. Where I am having trouble is when I try to pull the first element in each array … | |
Design Problem 1 1. Develop sigma and pie bonding and anti bonding molecular orbitals of 2s and 2p Using C or C++ programming language. Expected Outcome: I. Shape of molecular orbitals must be known in depth. II. Proper assignment of bonding and anti bonding molecular orbitals should be stated. III. … | |
Hi, I have some experience with C++ and FORTRAN. I would like to write software to help me visualize shapes in a GUI-based program. Where is a good place to start? Books, websites, etc that would help me get an idea of what is needed would be good. Thanks! | |
I'm new at C++ and I'm trying to right a program that will generate random numbers from a range of 1-19. Here's how it should work, the program will generate 5 random numbers all ranged 1-19 and in random order. Once it chooses the first number, that number used for … | |
i'm a complete beginner to C++. its my fourth week learning it. we have this for a homework assignment: "This program outputs all prime numbers between 3 and 100 using a doubly-nested loop." first off, i've done a lot of research online and from what i've seen the most efficient … | |
I need to write a function splitMid that will split a linked list into two sublists of equal size. I have written most of the functions that I need to achieve this and some other things, but I am having trouble getting started on this function. Can anyone point me … | |
I need to compute the number of nonnegative numbers from an input file. Everything works fine (for good input files and bad input files) except when there is a no data file (with nothing in it). Then, the number of nonneg numbers reads 1, even though it should be 0. … | |
i'm in a beginning c++ class and we have to write a program that finds all primes between 2 and 100 within a doubly nested loop. i feel like i'm really close but i think i've been doing it too long and can't figure out what i'm doing wrong...... help … | |
Hi everybody, i am a new in c++ programming ,, and i am trying to answer this question to get the required result, but i could't till now .. i need your help in order to be able to answer this question correctly. the question is : write a program … | |
how i could make calculator inc++ that do calculation in regular interval like it do calculation as same as the calculator | |
I am a beginner level C++ student, so please forgive me if I use the wrong terminology here....I need to create a program that takes a set of integers from a source file, tells whether the numbers are odd or even integers, and then adds the odds and the evens … | |
What are instance variables please? Also, is this a good explanation for Encapsulation: Encapsulation or information hiding is all about hiding the details of the implementation of the interface. Encapsulation is used to prevent users from viewing the inner workings of the interface. A real life example of Encapsulation is … | |
i am new in programming . i have a clock code. but want to modify it. when user press "0" it increment in time by 5min and when press "1" increment time by 10 min _______________ [CODE]//The complete program listing of the program that defines //and uses the class clockType … | |
Hey, I'm just wondering if it's possible to run an if statement through a class? The thing is, I wanna store users details and then when you search for a user, i.e "Phill" it returns all the information on that user. I'm using something like: [CODE] c1.GetName(); [/CODE] So something … | |
[ICODE] * Don't use system("pause") to pause your program if possible. Use getchar( ) if you are using C and cin.get( ) if you are using C++. [/ICODE] Why is that? A reasonable explanations for those tips would help to learn. | |
Hey guys i've tryed to find how to do this the best way but it failed. So i want to ask the experts here: How to add a new line of text to a edit control. Example: I have alredy some text in the edibox and i want to add … |
The End.