49,761 Topics

Member Avatar for
Member Avatar for zawpai

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 << …

Member Avatar for zawpai
0
110
Member Avatar for hazmatt

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 …

Member Avatar for hazmatt
0
308
Member Avatar for wellibedamned

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; …

Member Avatar for wellibedamned
0
110
Member Avatar for cobaltbass

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?

Member Avatar for Duoas
0
261
Member Avatar for nlsna17

:!: 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 …

Member Avatar for Bitto11
0
174
Member Avatar for AqAbAwE

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.

Member Avatar for AqAbAwE
0
73
Member Avatar for daviddoria

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 …

Member Avatar for Radical Edward
0
94
Member Avatar for kasippu

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 …

Member Avatar for Abzero
0
87
Member Avatar for mussa187

[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 …

Member Avatar for VernonDozier
0
96
Member Avatar for toolbox03
Member Avatar for lahom

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

0
76
Member Avatar for Kadence

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?

Member Avatar for Ancient Dragon
0
54
Member Avatar for joshmo

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 …

Member Avatar for joshmo
0
120
Member Avatar for CoolGamer48

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: …

Member Avatar for mitrmkar
0
83
Member Avatar for jmines

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?

Member Avatar for Salem
0
162
Member Avatar for v@$@nt

please help me in writing a code to implement stack using arrays , does stack follow LIFO or FIFO principle?

Member Avatar for n1337
0
110
Member Avatar for computer engW

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 …

Member Avatar for computer engW
0
178
Member Avatar for shobhit saxena

hello all, can somebody tell me what's the use of protected default constructor & protected copy constructor in c++.

Member Avatar for Ancient Dragon
0
52
Member Avatar for sieghart0123

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 …

Member Avatar for sieghart0123
0
126
Member Avatar for daniel88

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 …

Member Avatar for daniel88
0
138
Member Avatar for Nemoticchigga

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: …

Member Avatar for Ancient Dragon
0
110
Member Avatar for bonnie1234

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 …

Member Avatar for Ancient Dragon
0
104
Member Avatar for K1Kingy

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 …

Member Avatar for Salem
0
64
Member Avatar for Mehwish Shaikh

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); } } …

Member Avatar for VernonDozier
0
86
Member Avatar for petzoldt01

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 …

Member Avatar for petzoldt01
0
354
Member Avatar for daviddoria

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 …

Member Avatar for Duoas
0
108
Member Avatar for Black Magic

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 * ** *** **** ***** ****** ******* ******** ********* ********** …

Member Avatar for William Hemsworth
0
98
Member Avatar for daviddoria

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]

Member Avatar for Narue
0
145
Member Avatar for computer engW

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 …

Member Avatar for computer engW
0
97
Member Avatar for Run.[it]

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 …

Member Avatar for Run.[it]
0
179

The End.