49,761 Topics

Member Avatar for
Member Avatar for faraz ahmad

Hello All, i have written a program to read data of Persons from a file and fill the data into a dynamically created array of Persons. i am geting error in line 28 plz help the 1.txt file can be assumed as:(first line is the no of persons, then names …

Member Avatar for ravenous
0
320
Member Avatar for caltech

int findLowest(int arr[]) Is passed the five accident totals as an array of ints. It determines which is the smallest and returns the subscript for that array element. The main function declares two arrays, a string array containing the names of the boroughs and an int array which will hold …

Member Avatar for caltech
0
233
Member Avatar for KRUX17

Hello, I would like to know how you can keep running a function over and over again, so that it can keep adding the stored value. For example If Bob uses a program to purchase a ticket, lets say that Bob purchases 5 tickets out of 55 tickets (There's only …

Member Avatar for irre
0
201
Member Avatar for radiat
Member Avatar for Kathyrine

I wanna convert an integer to a character then i will store it later to the index of a c-string...... something like... int res=123 then it will be putted in.... var[0] = 123 where in var is a cstring, and here 123 is now a char type..... here is what …

Member Avatar for Software guy
0
200
Member Avatar for jonnyboy12

Hello all. i might have posted about this recently but, i have done much research and refined my research and am close to a solution. I am trying to use the click of a ahref link with a variable tacked on the end, to send a message to one of …

Member Avatar for jmichae3
0
186
Member Avatar for Buffalo101

Hi, I'm trying to create a thread for running some tasks. I copied the code from an old console application (which compiles fine), but can't figure out why it's not working now. I have searched for the error code and came across this suggestion: "Are you passing the name of …

Member Avatar for jmichae3
0
685
Member Avatar for SoftShock

Hello, On lines 70 & 75, the word [B]col[/B] is marked as a syntax error. When I hover my mouse over, it tells me that [B]Error: expression must have pointer-to-object type.[/B] Why am I getting this error and how do I fix it? This program prompts & reads the file …

Member Avatar for Labdabeta
0
194
Member Avatar for FelineHazard

Hi all, I'm having some troubles practicing linked-lists: the problem calls to implement string as a linked-list of chars. So I created a new class - mystring and defined building function, show(), and also destructor. The build and show works correctly. I get the exact same string I sent as …

Member Avatar for FelineHazard
0
118
Member Avatar for markrodriguez0

The idea is to get a sentence of words and then scramble the middle letters of each word without altering the position of the word in the sentance. So for example, the user inputs: Programming is very interesting! the output should be: Pogrmarmnig is vrey itenrseitng! So far, i have …

Member Avatar for iamthwee
0
1K
Member Avatar for caltech

Sorry the subject is hard to read I had to fit it all in there briefly but so in this external function getNumAccidents I need to read in the user-input number of accidents for each NYC borough to be stored in their respective array places, but also validate the input …

Member Avatar for caltech
0
165
Member Avatar for mrmodest34

Alright, I understand some of the basics of big O notation, but I have a test coming up in a few days and I need a bit of help. I understand that if you have a loop that iterates i*=2 then it would run lg(n+1) as log base 2 and …

Member Avatar for histrungalot
0
205
Member Avatar for P3rryD

HI, I recently joined the forums (today) and i would officially like to say hi. [COLOR="Green"]HI[/COLOR] For my question: [COLOR="Red"][B]Are there any books,websites or tutorials that use a moderate vocabulary that teach C++?[/B][/COLOR] Thanks for the help in advance. BTW is there a rules page? _______________________________ Bye

Member Avatar for WaltP
0
174
Member Avatar for toyotatundra

this runs but with unexpected results,why?I insist on using cin.getline and I was hoping if statement will execute, however the else statement is da one dat executes. As for the question I think the first answer is correct char name[256]; cout <<"enter name"<<endl; cin.getline(name, 256); if (name == "My boy") …

Member Avatar for NathanOliver
0
123
Member Avatar for mrcerimo

I'm trying to make encryption program but when i run the program it gives me this error: Debug Assertion Failed! Program:...nts\visual studio 2010\projects\encrypter\debug\encrypter.exe File:c:\program files\microsoft visual studio 10.0\vc\include\xstring Line:1441 Expression: string subscript out of range For information on how your program can cause assertion failure, see the Visual C++ documentation …

Member Avatar for mrcerimo
0
309
Member Avatar for ashsha

From A C++ beginner. I have written a class that splits the first list into 2.I used iterators to accomplish it. Now I am supposed to create a new method that splits the input chain ∗this, destroys the input chain and uses its nodes to construct the chains a and …

Member Avatar for ashsha
0
179
Member Avatar for ads1188

Hi all, I have 2 forms, form1 is for entering Name, ID and School. I want all the data i enter in form1 to show in a table in form2. Can someone recommend which way is best of doing this? Many Thanks

Member Avatar for Ancient Dragon
0
104
Member Avatar for Z33shan

hello :) i'm using MFC SDI, & i'm less familiar to it. i need to know, 1: i have found a way of printing a string as [CODE]pDC->DrawText( " Task still pending!!! ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i want to know, how can i print a 2D-Array in MFC …

Member Avatar for Ancient Dragon
0
392
Member Avatar for sudheer2250

Hi All, I am trying to convert the following C++ code to C#. pExportDir = (PIMAGE_EXPORT_DIRECTORY)GetPtrFromRVA(exportsStartRVA, pNTHeader, pImageBase); [CODE]template <class T> LPVOID GetPtrFromRVA( DWORD rva, T* pNTHeader, PBYTE imageBase ) // 'T' = PIMAGE_NT_HEADERS { PIMAGE_SECTION_HEADER pSectionHdr; INT delta; INT delta2; pSectionHdr = GetEnclosingSectionHeader( rva, pNTHeader ); if ( !pSectionHdr …

Member Avatar for sudheer2250
0
451
Member Avatar for maxmeier

Hi all, I want to store the result of a SQL query into some kind of container. Typically, a result consists of several columns, each of which has different types - depending on the query. E.g., 'select productname, price, stock_count from...' leads to 3 result columns: char, float and int. …

Member Avatar for maxmeier
0
144
Member Avatar for rickenjus

[b]I want this code to call generic catch block whenever any special character(eg. !,@,#,$,%,&,*, etc) is enetered in numerator or denominator. So what code should I add to this. Any help would be appreciated. Thanks. [/b] [code=c] #include <iostream> using namespace std; int main() { try // generic catch block …

Member Avatar for thines01
0
372
Member Avatar for Labdabeta

I am getting ready to write a programming competition on Tuesday (the Canadian Computing Competition) and I remember that last year it said that only standard libraries can be used. I was having trouble deciding which libraries are standard. I ended up using windows.h and when I suddenly realized that …

Member Avatar for Labdabeta
0
188
Member Avatar for delgadough

Hey all, I am working on my first C++ prog and I'm having an issue on my output. I compiled the code ok but when i try to execute, the output comes up with weird numbers and letters where it is supposed to display the "photos in"[CODE]// Name: Danny Delgado …

Member Avatar for delgadough
0
111
Member Avatar for MrEARTHSHAcKER

Hi, I am learning templates so I have one question for this code: [CODE]template<typename T, int Number> class Data{ T Array[Number]; public: T& operator[](int); }; template <typename T,int Number> T& Data<T,Number>::operator[](int element){ return Array[element]; }[/CODE] I wish to create specialization for that class template, for any random data type, but …

Member Avatar for MrEARTHSHAcKER
0
914
Member Avatar for mfcdoubt

I have following header file defines test2.h ----------> header file template<class T> class temp2 { public: temp2(); virtual ~temp2(); }; test1.h ----------> header file template<class T> class temp1 { public: temp1(temp2<T> (temp2<T> *temp2ptr); ~temp1(temp2<T> (); protected: temp2<T> *tempptr; }; test3.h -------------> header file class test3 { public: test3(); virtual ~test3(); …

Member Avatar for huda_7978
0
3K
Member Avatar for ads1188

Hi all, I am new to programming and having been experimenting various codes recently. I have managed to link 2 form so that when i click a button on Form1, Form2 opens. I am using the code [CODE]Form2^open2 = gcnew Form2(); open2->Show();[/CODE] This codes work fine. Is there a way …

Member Avatar for ads1188
0
110
Member Avatar for infamous1987

One way to measure the amount of energy that is expended during exercise is to use metabolic equivalents (MET). Here are some METS for various activities; Running 6 MPH: 10 METS Basketball: 8 METS Sleeping: MET The number of calories burned per minute may be estimated using the formula Calories/Minute= …

Member Avatar for Software guy
0
1K
Member Avatar for Kanoisa

Hi all, I have started finding lots of uses for abstract classes to define interfaces for common functionality using polymorphism and i know that using polymorphism and virtual functions incurrs some additional call cost of functions. So what im wondering is can i get the best of both worlds? consider …

Member Avatar for Kanoisa
0
192
Member Avatar for Awah Mohamed

Hi guys, how are you? Well, i have my science fair soon and i want to build a software that can copy any given file to any removable device that gets connected to the computer it is running on.. But the problem is i dont know how to do this... …

Member Avatar for BobS0327
0
989
Member Avatar for Z33shan

hello :) i've Two questions to ask. i'm working on MFC SDI, i'm less familiar to MFC. i found that a way to print a string in MFC SDI is: [CODE]pDC->DrawText( " mc Test Ellipse ", &rect , DT_PATH_ELLIPSIS );[/CODE] but i have to print a 2D array in MFC …

0
126

The End.