49,756 Topics

Member Avatar for
Member Avatar for sieghart0123

I’m a beginner in C++ programming, so please forgive me if this question is somewhat absurd. I am just wondering which approach is better: [INDENT]1. Upon program start-up, create an array of objects based on data stored in a text file. When the program terminates, the array of objects (and …

Member Avatar for Radical Edward
0
78
Member Avatar for Jennifer84

I have a ZedGraphControl on my Form. When the form open there is a lot of code that will draw a graph. A few lines of this code is in the first codeview here. From what I can understand, I beleive this code will execute once when the Form opens: …

Member Avatar for Radical Edward
0
140
Member Avatar for brk235

Hi friends..i have doubt about C++ programming. How to give names for the elemetns in an array of objects...

Member Avatar for vijayan121
0
101
Member Avatar for joshmo

how can i check if my text file is empty??? i have tried something using eof but it doesnt seem to work or am just using it wrongly [code] if(infile.eof())//check if it is empty /*also tried this*/ if(infile.eof()==0) [/code]

Member Avatar for Radical Edward
0
102
Member Avatar for timdog345

This is what I have, but I need to make a for loop instead of the initialize steep. PLEASE HELP [code] int main () { int numb[10];//1,2,4,8,16,32,64,128,256,512 int numb2[10]; int counter, counter2; /* numb[0]=1,numb[1]=2,numb[2]=4,numb[3]=8,numb[4]=16,numb[5]=32; numb[6]=64,numb[7]=128,numb[8]=256,numb[9]=512; numb2[0]=0,numb2[1]=1,numb2[2]=5,numb2[3]=3,numb2[4]=10,numb2[5]=5; numb2[6]=15,numb2[7]=7,numb2[8]=20,numb2[9]=9; */ for (int z=0; z<10; z++) cout<<numb[z]<<" "; cout<<endl<<endl; for (int x=0; x<10; …

Member Avatar for timdog345
0
80
Member Avatar for purepecha

[code=cplusplus] //I got almos this program done, it gets the apropiate result skipping some steps. //How do i pass the "int diff" to the "printText function". diff is the largest elemt or the //more repetitive letter from a text file, where the alphabet was shifted by 12. //Also, The largest …

Member Avatar for William Hemsworth
0
99
Member Avatar for Gagless

I want to recursively check if two strings are equal, not in size, but character by character. I am unallowed to use loops and the == operator. I tried to use two parallel arrays, but when testing my function I got undesired results. Here's what I came up with: [CODE]int …

Member Avatar for William Hemsworth
0
1K
Member Avatar for grommet2481

Hey I know this is really simple, I'm studying my first course of C++. In my prac for the week it asks: "A TrainCar is a base class representing carriages for a train. It defines no attributes but has a public function called shape which accepts no arguments and returns …

Member Avatar for Asat232
0
143
Member Avatar for Adrian99420

Hi, I created a checklistbox and binded the display value from a MS-Access table. Next, I am trying get the checked item but I keep getting "System.Data.DataRowView" Here is what I did: [CODE] private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) { this->oleDbDataAdapter1->SelectCommand->CommandText="SELECT DISTINCT Profile_Name FROM Profiles"; this->oleDbDataAdapter1->Fill(dataSet1,"Profiles"); DataTable^dt= dataSet1->Tables["Profiles"]; checkedListBox1->DataSource= dt; …

Member Avatar for mitrmkar
0
144
Member Avatar for C_isoundu

Here is my problem, if you run the program(using piping), it should output the followings: [ICODE]========================= PHANTOM COMPANY INVOICE PRODUCT ID QUANTITY PRICE ($) COST ($) P010001 2 24.99 49.98 DVD-player5 1 58.95 58.95 P010002 20 8.85 177.00 ... TOTAL COST = $xxxxx.xx[/ICODE] my invoice is not the same as …

Member Avatar for joshmo
0
104
Member Avatar for risa

How to close dialog box if it doesnt hav OK and CANCEL Button in windows programming.the dialog box is shown with DoModal which inturn calls onInitDialog().But how to close it ?does EndDialog hepls and how ?where to call EndDialog?

Member Avatar for Anitaj
0
215
Member Avatar for zawpai

Hi, I get some problems when I run the following codes. #include<iostream.h> class Distance { protected: int feet; float inches; public: Distance() { feet = 0; inches = 0; } Distance(int ft, float in) { feet = ft; inches = in; } void get_dist() { cout << "\n Enter feet …

Member Avatar for Nick Evan
0
229
Member Avatar for lifesuk

i am new to c++, currently working on an assignment, now i'm stuck in skipping the comment lines in the txt file. the txt file is something like this: #com1 A1 A2 A3 #com2 B1 B2 B3 ... what i need to do is to enter commands to display the …

Member Avatar for Nick Evan
0
3K
Member Avatar for Black Magic

Hey, I am not stuck on this or anything just a bit confused about if this is the right way to go.. Well i was wondering on the river (five cards that go into the middle of the table) i am going to make them random and that is no …

Member Avatar for Salem
0
99
Member Avatar for Kadence

I'm confused about the use of the dereference operator in the declaring of char arrays. I think I understand that the dereference operator is used to dereference memory addresses to their values, and also in an unrelated function in the declaration of pointers; and that arrays are like special pointers …

Member Avatar for Salem
0
200
Member Avatar for lahom

hi Iam creating an application(vc++) which supposed to find the similarity between two programs written in c++ (at SYNTAX and SEMANTICS). in SYNTAX: i used the tokenize method and save it in strings...thats works but the question is here in the SEMANTICS: how can i trace the semantics in the …

Member Avatar for Duoas
0
68
Member Avatar for Dr. Kelwin

Hi, all! How can i do handshake before using BIO pairs for encrypt/decrypt, if as transport i use Winsock(WSASend and WSARecv)? some example this is send function: [code] DWORD CSSLTLSLayer::Send(IN OVERLAPPED *pOverlapped, IN WSABUF *pBuffer, OUT PDWORD pdwWasSend) { size_t iBuffered = BIO_write(m_pSSLBIO, pBuffer->buf, pBuffer->len); BIO_flush(m_pSSLBIO); iBuffered = (int)BIO_ctrl_pending(m_pNetworkBIO); if …

0
51
Member Avatar for Talianika

Hi! Programing a program with the fibonacci numbers, but having some problems getting the program to work as it should. The problem is that the user which is using the program are going to type a "max value" of how far he wants to count the fibonacci numbers. So if …

Member Avatar for wellibedamned
0
118
Member Avatar for shankhs

hey guys do u know any good on line tutorial of graphs? ya i know there are many but i want the one which has source code to play around...... PLUS a detail description.... Thanx

Member Avatar for shankhs
0
98
Member Avatar for savinki

I want to split data in a string. The string will consist of several data. Before every element the length ofthe element will come. I want to exract data one by one. e.g. char * abc = "[length ]acsfdnhsjg[len]gvsdgdvheg[len]efgwetrge"; can someone help me!!!!!!!

Member Avatar for Radical Edward
0
166
Member Avatar for jpd727

Hey all, When I write even a hello world script like below [CODE]#include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; } [/CODE] the windows command line flickers when trying to execute it, instead of staying there and showing me ? Is there anyway to refresh or make this start …

Member Avatar for Radical Edward
0
104
Member Avatar for Onixtender

Hi , this pr. works with clases but someway it just throws me a error: [code] switch (atoi(i))//yes its an int 1,2,3,... etc... { case 1: R S(r, h);//create new class R object named S,to constructor we give two parameters F * f1 = &S; //yess pointers polymorph.... cout << …

Member Avatar for Onixtender
0
79
Member Avatar for &rea

Hello, I am programming an image application for my thesis. I have got an image and I want to have the color of each pixel so I can make my own histogram. The problem is that I want to treat this histogram as an array but I don't know how …

0
59
Member Avatar for Run.[it]

Basically this Menu works however, when I enter in a string the default does catch it but then the Menu repeats the error so in essence isnt full proof. Would the way around this be to check the 1st entry by the user to see if its an integer, if …

Member Avatar for Run.[it]
0
140
Member Avatar for donnerCobra

Hi, I wanted to ask if you can help me with my example-sourecode to Wrap an C++ Object. I know Boost, but I don't want to use it cause of several points. Does someone knows an example code for an Object Wrapper? Thanks A LOT!!! [code=c] #include <Python/Python.h> #include <string.h> …

0
63
Member Avatar for TylerTCF

I have commented the problem into the code below. See the Store2 vector in the Write Data function. I get error 0xC0000005: Access Violation with no warnings. Any help figuring out why would be appreciated. [ICODE] #include <iostream> #include <fstream> #include <string> #include <sstream> #include <vector> #include <stdlib.h> using namespace …

Member Avatar for mitrmkar
0
130
Member Avatar for Spartan552

Hi guys ! This has been killing me for 8 hours Things work well I'm compiling this way : [QUOTE] g++ -Wall -o prog prog.cpp -L/usr/local/sesam/lib -Wl,-rpath /usr/local/sesam/lib -Wl,-rpath,/usr/sesam/lib -ldl -lc[/QUOTE] But when I add a link to /usr/local/sesam/lib/libssv.so that i need [QUOTE]g++ -Wall -o prog prog.cpp -L/usr/local/sesam/lib -lssv -Wl,-rpath …

Member Avatar for Spartan552
0
166
Member Avatar for Xokzin

Hi There, I'm learning C++. One of the questions requires a function to do a calculation below. I have no clue how to do this. Can anybody help? [QUOTE]WeTryToHelp gives bursaries to help students with buying their textbooks. The amount of money depends on how many modules the student passed …

Member Avatar for Xokzin
0
124
Member Avatar for zoner7

Typically the code that I have seen uses phrases such as i++ as opposed to ++i. Recently, in a recently purchased book, I have seen the former implemented. As I understand i++ means that the addition takes place after the line is executed and thus with the initial value of …

Member Avatar for Abzero
0
178
Member Avatar for agodislife

Can someone help me with this probem please. Thank you. [code=cpp]#include <iostream> #include <iomanip> using namespace std; int main() { double pay_rate, hours, regular_pay; double overtime_pay, gross_pay, tax, net_pay; // The functions receive no parameters and return no results. // All communication is through the global variables. void Calculate_Gross_Pay(); void …

Member Avatar for Sky Diploma
0
88

The End.