- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 3
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I am having trouble devising a method to multiply 2 matricies that are formed by dynamic one dimensional arrays, for this case i just used matrix1 and matrix2 To access elements that are on rows 0 to n-1 in either matrix i have to use this method: ((rows - 1) … |
|
Why constructor can not be defined as virtual? Thanks |
|
Ok so I posted this before but didn't get a response... Our prof gave us this problem: "Write a program that will get, from the user, a string of characters such as a sentence, and place this into a declared char array. Ask the user which letter they would like … |
|
Does it need a copy constructor and an operator= for a class which have array member? for example: Class A { private: B data_[100]; //B is a class }; does class A need a copy constructor and an operator? in other words, is the default copy constructor is OK for … |
|
Some of my source files include the following code. [code] #ifndef AAAAAAAAAAAA #define AAAAAAAAAAAA #if !defined(__lint) && !defined(_lint) XXXXXXXXXXXXXXXXXXXXXXXXX; #endif #endif [/code] I want to delete line1, 2, 6. So, Could somebody tell me how to do it? thank you in advance! |
|
I am creating a linked list which links a struct of data together. However, this is my problem, if I declare struct Node first then the Event type wont exist, but if I declare struct Event first then nodePtr wont exist....im kinda stuck here as to how I should declare … |
|
The following code is part of a program to document the book in my house, like those things they have at public libraries. I learned about minupulating files in programs last night and have many errors in this program. First, the c-style string for filename comes out as - filename.txt" … |
|
How do you delete the front cell of an array in an array based circular queue? Here's the Queue cpp functions [code] #include <iostream> #include <string> #include "Contributor.h" #include "myQueue.h" using namespace std; myQueue::myQueue() { front=0; rear =0; Index=0; size= 0; ArrayQ[10]; } myQueue::myQueue(const myQueue &CCmyQueue) { for(int i=0;i < … |
|
Hi all.... i have problem with number: example: 1234 is equivalent to 1432 ( based on maths concept), then erase/delete 1432 2143 is equivalent to 2341, then erase/ delete 2341, and so on How to program it in C++ |
|
Question is : Write a function [code=c++] int f(char* str, long pattern) [/code] to find out how many pattern does the str contain? str is a char array consist of '1' and '0'; for example: str = "11010101110101011110100011001" ,pattern = 110; My solution is change pattern and str to std::string, … |
|
Hello, I am a newbie and trying to pass a 2 - dimensional array to a function in C++ from main(). Then, [B]once inside that subroutine[/B], I want to [B]change the contents of this 2D array[/B] and be able to [B]access the changed elements of this 2D array later[/B] in … |
|
Hello, I'm almost done with this program, but when I want to sell an item (option 2) I get an error after I enter how many 'vector subscript out of range'. The program compiles correctly, but I cannot for the life of me figure this one out. Any Help? [code] … |
|
Hi, I wish to output a string from a textbox to another file, here is what I wrote: [code] FILE*myfile; myfile=fopen("D:\\Profiles\\DqGw47\\Desktop\\hello.txt","a"); fprintf(myfile,"%s\n",textbox1->text); fclose(myfile); [/code] In my hello.txt: Set wallpaper= My problem is how can I control where to fprintf my string. In this example, how can I output the textbox … |
|
What will happen if caught exception when new a object? For example: [code=c++] ClassTest* ptr = 0; try { ptr = new ClassTest; } catch(...) { } [/code] if the constructor of ClassTest throw exception, what will happen? will ptr == 0 ? some memory leak? |
|
I am getting this error and i don't know what it means. this is my code, i do have header files but i didn't include them. [code]int main() { [LIST=1] [*] cout<<"Welcome to guitar hero"<<endl; [*] cout<<"Try and press the correct letters on the line"<<endl; [*] cout<<"You will use the … |
|
Okay I'm gonna be honest with you... I have no idea what I'm doing... no not even a little. I'm in an online C++ class that I'm only taking because it was the last required course for me to graduate this semester... This is the last assignment due and I … |
|
I've searched Google and have not found a solution to my problem. Function is to take a parameter and do a calculation on it. Based on the initial conditions it is supposed to return true and the the value calculated via a reference parameter. Basic code before all modification to … |
|
i'm trying to write a program that reads a text from the user(keyboard) sentence by sentence and then prints the 'morse code' of them char bay char on a text file. I'm just testing it for the letter 'c' to start with, but it doesn't seem to be working well … |
|
How to change this data sturucture from vector <int> total; to float total;? because if I change it to float teher is many error.... [code=C++] #include <iostream> // std::cout #include <fstream> #include <iomanip> #include <string> // std::string #include <vector> // std::vector<> #include <algorithm> //std::for each() using namespace std; // import … |
|
Hi, I am working on a project wherein one program writes to a file, but allows a different program to read from that file BEFORE the first program is finished writing to it. In this project, the first program is a game. When someone scores in the game, that activity … |
|
For a singleton class, there is only one instance in a process, so it's not necessary to define a member function as static, am I right? Thanks in advance. |
|
[code] void ChangeAddress() { char searchaddress; char newaddress; cout << endl; cout << "Please enter street name to be changed "; cin >> searchaddress; for (int i=0; i<numrec; i++) { if (strcmp(SubscriberID[i].Subscriber_Address.streetname, searchaddress) == 0); { cout << "Enter the new street name: "; cin >> newaddress; } } } … |
|
Hello all: I create a simple source file in VC++ , I tried something simple,there is two strings: string1:MICROSOFTCPP string2:HELLO I want to write a code to make string2 is equal with string1,so it must be string1:MICROSOFTCPP string2:[COLOR="Green"]HELLO[/COLOR][COLOR="Red"]HELLO[/COLOR]HEL so it seem the string2 its repeat itself until it's length is … |
|
There are two way to define a character array constant: 1. const char* const OUT_STRING="hello world"; 2.const string OUT_STRING="hello world"; which one is better? why? |