49,761 Topics
| |
Hi, Why the program skip 'read value' in second time? First time reading value is ok, but the problem will get after pressing 'Enter key' for the next time read. [CODE] //array of pointers to person objects #include<iostream.h> class Person { protected: char name[40]; public: void getname() { cout << … | |
I have been searching for days to find an Http Client in C++ that I can use. I am assisting in a research group involving camera recording based on sensor detection and am responsible for making the interface with the cameras. I have some work that was done before I … | |
could someone please check this code and tell me where i went wrong... it always gives the result 1.00000 but as you can see in the for loop it shouldn't be like that. [CODE]#include <cstdio> int main(void) { int n; float s = 0; scanf("%d", &n); for(int i = 1; … | |
Whenever I start my program from the command line, it works perfectly. When I try to use the icon on the desktop, it gets to the last cin statement and terminates. I have no idea why this would happen. Any insight? | |
:!: Write a program that reads in an m by n matrix row by row, then reads in an n by p matrix row by row, and then computes the product matrix and displays the two matrices, as well as their product matrix on the screen. Use integer values for … | |
lets say I have a class named MyClass, and a variable named val, what does the following statement mean? i know its dynamic allocation, but what does the ** indicate? MyClass **p1 = new MyClass*[val]; thanks for your help. | |
I have about a 1gb data file that needs to be read at the beginning of my program. This takes about 2 minutes to do. I feel like the answer is "no way", but here is my question. In matlab, there is the concept of a "workspace". I can ready … | |
01. ) during sorting , if we wish to swap the items in 2 positions , we simply swap the pointer values and leave the main data table unchanged:: what is a possible advantage and disadvantage of doing this .. ?? 02. ) what would be the effect of incrementing … | |
[B]Okay i thought i have solved the problem i had obviusly with ur help guys but i guess i was doing it wrong, here is what i am suppopse to do:[/B] BACKGROUND This is the same as the DNS pointer problem except ypou must structure your code into a class … | |
hi how can i move from one dialogbox in one project to another one(dialog box)placed in different project? for example...press abutton in dialog A -> move to dialog B.. any suggestions any way that could help would be appreciated thank u all | |
Are there any functions to calculate, or common techniques to estimate, how much memory a C++ script is consuming at a given moment/place in the code? Maybe some built-in function that keeps track of bytes used? | |
am trying to delete an element from my list but am having a problem..i have managed to position my pointers well but av failed to to the actual element. i.e user enters a number to be deleted from the list..here's the bit of the deleting code that i have been … | |
Hey, when I run this code: [CODE=Cplusplus]else if(strcmp(buffer,"#itemSprite") == 0) { char* sprite_filename = ""; int trans_r; int trans_g; int trans_b; int width; int height; int numFrames; int numCols; int frameChangeDelay; fscanf(file,"%s",sprite_filename); fscanf(file,"%d",&trans_r); fscanf(file,"%d",&trans_g); fscanf(file,"%d",&trans_b); fscanf(file,"%d",&width); fscanf(file,"%d",&height); fscanf(file,"%d",&numFrames); fscanf(file,"%d",&numCols); fscanf(file,"%d",&frameChangeDelay); item->SetSprite(sprite_filename,D3DCOLOR_XRGB (trans_r,trans_g,trans_b),width,height,numFrames,numCols,frameChangeDelay); }[/CODE] I get an error on this line: … | |
I want to change the background color of the output screen in Dev-C++. How can I do that? I searched the Internet but didn't find any. Any help on which function should I use? | |
please help me in writing a code to implement stack using arrays , does stack follow LIFO or FIFO principle? | |
Here i have problem with ctype.h library .I think i use correctly,but i ahve an error on it. This is the code. [ICODE]#include<iostream> #include <ctype.h> using namespace std; int main(){ char letter; int num; int isdigit(int letter); int isupper (int letter); int islower( int letter); int small=0; int capital=0; int … | |
hello all, can somebody tell me what's the use of protected default constructor & protected copy constructor in c++. | |
I'm new at C++ programming and am working on an assignment. I've managed to compile my codes alright but got an error while testing the program. The error surfaced halfway through viewing details of a linked list, where suddenly, the program started printing weird characters while the computer emit beeping … | |
Hi guys! I am currently having trouble in the final stages of an assignment which involves linked lists and dynamic arrays. The assignment involves adding books to a library. This means that each record has a title and one or more authors. I have worked out what I think was … | |
I am using the begininvoke and endinvoke methods in visual studio 2005. [CODE] private: System::Void button_run_Click(System::Object^ sender, System::EventArgs^ e) { AsyncCallback ^ac = gcnew AsyncCallback(&InvokeTest::Form1::delegate_function_callback); delegate_function ^df = gcnew delegate_function(this, &InvokeTest::Form1::function_to_invoke); df->BeginInvoke(ac, df); } private: delegate int delegate_function(void); public: int function_to_invoke(void) { label_status->Text = "Running"; //label_status->Text = "Stopped"; } private: … | |
i really need help with this code. i am writing a truss analysis program and i'm confused with my push button. in my GUI i have 2 edit boxes and a push putton, when the information is entered into the edit boxes and the push button is pressed, the truss … | |
I have just got a laptop cooler that has 3 fans built in to it. It plugs in through the usb. What i am trying to do is make a small c++ program that is able to start and stop the usb device. It would make it a lot easier … | |
Following code is implementation of stacks.. but its giving two errors [code=cplusplus] # include<iostream.h> # include<conio.h> # define SIZE 20 class stack { int a[SIZE]; int top; // Top of Stack public: stack() { top=0; } int overflow() { if(top==SIZE) { return (1); } else { return (0); } } … | |
Im currently trying to work with a program that reads raw DV and dumps each frame in the form of a PPM file. I need to read the PPM's into OpenGL Textures and display them. But that is not the problem. The program has the ability to dump all of … | |
I have a function: void CreateCostGrid(vector<ScanPoint> &Data, int whichcol, vector<LiDARScan> &LiDARGrid); That I call like this: CreateCostGrid(TestScan.getColumn(GoodCols.at(testcol)), GoodCols.at(testcol), ModelScans); But I get this: error: initial value of reference to non-const must be an lvalue CreateCostGrid(TestScan.getColumn(GoodCols.at(testcol)), GoodCols.at(testcol), ModelScans); (There is an arrow underneath the T in TestScan, i guess indicating that … | |
Code Should Explain It self.. [CODE=C++]#include <iostream> using namespace std; int main() { unsigned int digit; for( digit = 0; digit < 10; digit++ ) { /* I WANT THE OUTPUT TO CARRY ON UNTIL DIGIT == 10 & OUTPUT * ** *** **** ***** ****** ******* ******** ********* ********** … | |
I'd imagine there is a much better way to do this... [code] vector<double> Model; //code to fill Model vector<double> V1; for(int i = StartModel; i <= EndModel; i++) V1.push_back( Model.at(i) ); [/code] | |
Hi, When i write any code has if else statement , and run it na error appeatrs and say that else doesn't match with if [U]or[/U] illegal else without matching if. I don't know where is the problem exctly ,and you should know that i don't put } in these … | |
Im trying to carry out input validation on a piece of code and have come across an issue. Basically for the 1st input I used getline for the string and then for the 2nd input I use cin for the integer. I am aware you can convert the integer from … |
The End.