49,757 Topics
| |
Hello community. I am writing a program that will use multiple threads to run MATLAB functions inside of Cpp by using the MATLAB compiler to create a DLL. I have already written the MATLAB DLL and I have everything linked up just fine, but now I need to split this … | |
Hey, here are two codes and with one slight difference they do different things [B]CODE 1[/B] [code] #include<iostream> using namespace std; int main() { char array[2]; int i=0; while (i<2) { cin>>array[i]; i++; } cout<<array[0]<<' '<<array[1]; } [/code] [B]EXAMPLE OUTPUT:[/B] [code] two words t w [/code] [B]CODE 2[/B] [code] #include<iostream> … | |
Below did not work. Is there anyother way? #include<stdio.h> #include<math.h> const int No=2; int* mat_sum(int[][No], int[][No],int); void main(){ int A[No][No]={{0,2},{0,1}}; int B[No][No]={{0,1},{1,0}}; int *Result=0; Result=mat_sum(A,B,No); } int* mat_sum (int A[][No], int B[][No],int length){ int *C=new int[No][No]; for (int i=0;i<length;i++){ for (int j=0;j<length;j++){ C[i][j]=0; C[i][j]=A[i][j]+B[i][j]; // printf("%2d",C[i][j]); } } return C; … | |
Hello, I was wondering if it was possible to take a string variable or an integer variable and send it to another computer like client/server architecture and also read that data from that same computer. I am thinking that winsock will be ideal for doing this but if anyone knows … | |
I am a beginner and am learning C++ and QT I would like to know how to make an interface like the one in windows media player 11 - one that is completely custom including the minimise and close icons. What would this involve? | |
[code] #include <iostream> using namespace std; class CRectangle { int x, y; public: void set_values (int,int); int area () {return (x*y);} }; void CRectangle::set_values (int a, int b) { x = a; y = b; } int main () { CRectangle rect, rectb; rect.set_values (3,4); rectb.set_values (5,6); cout << "rect … | |
Hey everyone, I'm a third year engineering student and a new programmer who needs to learn some C++ for a job this summer. My boss advised me to look into utilizing a hash table to get my project done. Hash tables aren't covered in the textbook I have. I've done … | |
| Hello, how can I create a window (best in Managed C++), that will stay in the parent form like MDI child. It's something similiar as in graphic editors (3DS,Maya). I attached an image how do I imagine it should be (Second window in image is the one I want to … |
Imagine a number system based on the entire English alphabet, that is, using the symbols "0ABCDEFGHIJKLMNOPQRSTUVWXYZ". Write a program that will calculate the sum of two numbers expressed in this system. The program should ask for the two numbers and output the numbers and their sum as follows (italics indicate … | |
Hi, I am a beginner in C++, I was just wondering what is it good for. This is probably a dumb question but I was searching on yahoo and google (What is C++ good for), and I did not find any real answers. What do people use it for? Is … | |
hello, ok i have this simple linked list program, as u can see below i got three functions: one to insert a node in the first of the list, the second to insert a node in the middle and the third to insert a node in the last of the … | |
What i want to do is write some of the rows of a report style CListCtrl with a color and other rows with another color, but if I switch the color with SetTextColor the color of the text in the entire control switches, i want it to switch just for … | |
ok here is exactly what Im trying to do, I have to insert 10 strings in 10 different textboxes in the shortest possible time (half a second counts), so I thought the best way is to store them all in a program before the timer starts and then simply press … | |
I am trying to make something work but are not sure what I am doing wrong. I have a comboBox where I will select an Item with the eventhandler below. When I select an Item I want the messageBox to show a message Once but the message is showing over … | |
Please see my post in the Community Introductions also. I know a little about C++. I'm committed to working in the DEV-C++ IDE environment. I want to learn very simple graphics. I went to the website: [url]www.uniqueness-template.com/devcpp/[/url] and found there the commands "moveto" and "lineto" as well as the linker … | |
I am currently reading the learn C++ in 21 days tutorial. In a chapter on references, when the author summarizes some of the main points inside a respective section, he explicitly states, "DON'T return a reference to a local object. " I am simply curious what this means. I have … | |
Hi all. I'm trying to write a 8 Queen Problem solving program in C++ as an assignement for an exam. I created a Matrix Board class to represent the chessboard with some functions such as put_Queen or check_Board for invalid positioning. I haven't yet begin to write the solving algorithm, … | |
I came here to see if I can get some help in C++, using the DEV-C++ IDE. I can write simple code to solve equations. Now, I want to graph the results. I got as far as using "initWindow", "moveto", and "lineto", to draw a figure. There must be a … | |
I'm having a small problem with debugging my application in VS C++. When I pass in a single parameter, the debugger insists 2 parameters have been passed in. The first parameter is invariably "d" and the second parameter is always the first character of whatever I pass in. Further, if … | |
If you use the new operator on a class, say [code=c++]class dummy { public: string f; }; int main(int argc, char *argv[]) { dummy *p = new dummy; return 0; }[/code] do you have to use the delete operator on [icode]p[/icode]? (since, apparently, it utilizes new.) | |
This isn't exactly a thread about a particular question, but a thread that may help people with memory dynamically allocated/deallocated during runtime. The below example goes over pointers in multiple dimensions-- [code=c++] #include <cstdlib> #include <iostream> /** This program can be used to determine whether pointers are deleted or not … | |
I've always used the Dev C++ compiler; however, I keep hearing how the software has little support. Additionally, I have heard people praise the debugger of Visual C++. So, end result, I'm deciding to switch from one to the other. My only problem now is that I can't make the … | |
Hi, I was recently reading a tutorial on C++ and I had a question about dynamic memory. The first paragraph of the tutorial stated the following: [I] "Until now, in all our programs, we have only had as much memory available as we declared for our variables, having the size … | |
I need some help keeping track of letters the user inputs. With my current code it only outputs one letter at a time of the word to be guessed. Can anyone help? #include <iostream> #include <fstream> #include <string> #include <iomanip> #include <time.h> using namespace std; void Hangman(); void LeftArm(); void … | |
Hi, I've been given the following task: 1. Read some .h header files from a few different folder in different directories. 2. Extract only the functions in the files and store all of them into a single text file. 3. Repeat the step 1 and 2 again but extract info … | |
How to setup Borland C++ IDE Environment? I've loaded the Borland C++, it went ok. Now what of the environment and the libraries, includes, and source directories. Apparently, the obvious isn't working. The following is how I have things set: Includes: c:\bc5\include ; c:\bc5\cpk6501\cpk6501\inc Library: c:\bc5\lib ; c:\bc5\cpk6501\cpk6501\lib Source: c:\bc5\output\intermed … | |
I get a "Debug Assertion Failed" when I go to run my program. More specifically it says "Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)". I assume this is because I'm using pointers incorrectly. Here is some information about the assignment: [quote]A file contains text representing a prioritized collection of messages. The messages were received one … | |
Is there a website that has some kind of GUI or application that allows users to enter statements like-- delete delete [] for... n elements... delete arr[n] --etc so that they can learn good memory management? I sifted around some free ebook sites and found one but the link to … | |
I have a program with a bunch of threads running. I kill them all at the end of the program. I have stepped through and seen them all abort. Is there a way to see (since I cant when stepping through) which thread it is? I can see the process … | |
hello Is there any way of getting the selected date in a CDateTimeCtrl in a CString or char* or anyting? thx in advance |
The End.