49,761 Topics

Member Avatar for
Member Avatar for cppnewb

I am having trouble using cin.getline and classes. Here is the code[CODE] #include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <fstream> using namespace std; class RememberPlans { public: string date; string subject; string resources; string description; }; RememberPlans nds; // Function Prototypes bool enterPlans(RememberPlans& nds); void exportData(RememberPlans& nds); void …

Member Avatar for cppnewb
0
410
Member Avatar for lakshmi mani

A University has decided to computerize its exam grading. They have a standard paper that contains 25 multiple choice questions each with four choices. All the answers by students are entered in a file. You are to read the file and calculate if the student passed or failed (60% or …

Member Avatar for Freaky_Chris
0
118
Member Avatar for tomtetlaw

Is there any macros in DarkGDK like this: [code=c++]#ifdef __DARKGDK_WINDOWS #include "MY_WINDOWS_HEADER.h" #else #include "MY_LINUX_HEADER.h" #endif[/code] any help would be appreciated, thanks in advance!

Member Avatar for Comatose
0
112
Member Avatar for d0pedup

I'm from a C background and need help with the following lines of code [CODE] struct IGame { // Summary // Entry function used to initialize a new IGame of a GameMod // Parameters // pGameFramework - a pointer to the game framework, from which a pointer of ISystem can …

Member Avatar for d0pedup
0
192
Member Avatar for 1bennyd

Hi guys, I have written some C++ code to do three things: 1. Read data from a delimited file (user specifies type of delimiter used), and return data as a "2D array". 2. Print 2D array to console. 3. Write the 2D array to a tab delimited text file. I …

Member Avatar for d0pedup
0
149
Member Avatar for a_best007

hi i am currently doing a project, and want to build in MFC...however i have just started working on it and find it really confusing... i have some doubts..please clear it as this is really very urgent(i have to complete the gui in a very short time) 1) I have …

Member Avatar for jencas
0
99
Member Avatar for kenji

Hey Guys, Im having a spot of trouble with dynamic memory allocation and any help would be appreciated. My problem is the I have 2 classes Bank and Account and I am making a dynamic array of the Account member variables. Everything seems to work fine until I try to …

Member Avatar for Salem
0
91
Member Avatar for homeryansta

[CODE]void getinput(char sentence) { cout << "enter something => " << endl; char ch; cin.get(ch); int count = 0; int i = 0; while(ch >= ' ' || count >= SIZE) { if (isalpha(ch)) { [B] [COLOR="Red"]sentence[i] = ch; [/COLOR][/B] i++; } cin.get(ch); count++; } }[/CODE] This is the function …

Member Avatar for homeryansta
0
66
Member Avatar for AdRock

I have made a base class and a derived class and I am having a couple compile errors. [QUOTE]SavingsAccount.hpp(9) : error C2512: 'Account' : no appropiate default constructor available[/QUOTE] What i want to do is be able to give the savings account an inital balance and it changes the currentBalance …

Member Avatar for AdRock
0
155
Member Avatar for LucyB

What operator would I use on a variable to increase it for addition from another variable. Thinking loops perhaps. Like the loop add's data to that variable but plus's it on, instead of changes it. So 50 + 60 = 110, instead of 50 + 60 = 60. Also, if …

Member Avatar for 1bennyd
0
143
Member Avatar for user2009

(Using MS Visual Basic 2008) Hi, I have been ask to create a program that allows the user to input the hours worked and the payrate for a number of employees (note: Hours work and the payrate can all be differ, there is no set payrate), the number of employees …

Member Avatar for user2009
0
70
Member Avatar for dvsConcept

Im getting these two errors, here is the whole code besides the edits and i know the edits works so their not important here. Error 6 error LNK2019: unresolved external symbol "int __cdecl loadArray(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const (* const)[2])" (?loadArray@@YAHQAY01$$CBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main Q6_A1_CODE.obj Error 7 fatal …

Member Avatar for dvsConcept
0
132
Member Avatar for mmeyer49

I'm writing a program to gain info and then print it. Problem is when a person enter $1231 for my account the $ crashes it. I would like to use cin.peek to check if it is there if it is delete it so far i have [code] cout << "Balance …

Member Avatar for mmeyer49
0
159
Member Avatar for sindorei

This is such a simple issue, it's embarrassing to have to ask.. but I've been having trouble with this theoretical issue of defining string arrays (and even integers!) outside of their class. Here's some code: [CODE]#include <iostream> #include <string> using namespace std; class desu { public: string ok[4]; // Give …

Member Avatar for sindorei
0
184
Member Avatar for RayvenHawk

Ok I have a problem here. I'm in my game engine class and for some unknown forsaken reason they decided to teach console c++ then jump to c# for windows apps, then back to c++ to do directx apps, so my skills with c++ and windows apps is well krappy. …

Member Avatar for Murtan
0
93
Member Avatar for Leopold

I'm VERY inexperienced in programming, I'm just learning the very basics. Anyways, I just figured out how to add a "pause" line to keep the program from closing as soon as I run it, but now there's a nasty "Press any key to continue" after my text. Is there a …

Member Avatar for William Hemsworth
0
10K
Member Avatar for Ronen444

Hi, First of all, i have a Resources.h file, which has the following statement: [CODE] #include <iostream> #include <string> #define string Greeting "Hi" [/CODE] So i also have Prompt.cpp; [CODE] #include <iostream> #include <string> #include "Resources.h" int main() { cout << Greeting << endl; system("pause"); } [/CODE] But, i have …

Member Avatar for Comatose
0
103
Member Avatar for Iruka_86

Hello, Can any of u help me with this assignment.. I tried to do it myself but cuz I'm new in Object Oriented my program was full of errors that I don't know how to fix :( Please help me as soon as possible.. here is the question: Write class …

Member Avatar for StuXYZ
0
177
Member Avatar for GURU1349

hello people, its the very first time im doing programming stuff.And i have done nothing so far.I found a booklet in my bookcase,it's about C++.,ts just the first booklet of a serie. i use visual c++ 2008 express,i did new>file>C++ i used the same codes as in the booklet,here it …

Member Avatar for Freaky_Chris
0
103
Member Avatar for Anbuvengeance
Member Avatar for Anbuvengeance
0
77
Member Avatar for college.student

I'm running a simlpe hello world program in visual c++ but in the console mode but i keep getting all these errors unbale to start program c:\users\johnathan\warfield\documents\Visualstdio2008\projects\program1helloworl\Debug\program1 helloworld.exe the system cannot find the specified file. how can i find this error???

Member Avatar for Comatose
0
110
Member Avatar for kaviths

[code] #include<iostream.h> using namespace std; class first { int reverse() { char name[]={'k','a','v','i','t','h','a','/0'}; int 1=0; while(name[i] != '/0') { i++; cout<<"value of i is"<<i<<endl; } } int main() { first f; f.reverse(); } }; [/code] my file's name is cpp.cpp and i cannot run it using ./a.out I get a …

Member Avatar for Freaky_Chris
0
88
Member Avatar for shaftoe3

Hi, when i run my program the following error occurs: "Unhandled exception at 0x00415b72 in testMatrix_size.exe: 0xC0000005: Access violation writing location 0xfdfdfdfd." and seems to happen over the line converting a string to double: n = Comma - Position; Numbers=line.substr(Position,n); Data[i][j] = atof(Numbers.c_str()); //problem is here. The program does the …

Member Avatar for Salem
0
123
Member Avatar for TasostGreat

I'm trying to write a program which reads a file really small size with two number and a character and ouput another file which can have up to 120.000.000 characters. is unistd equal to direct system call function? and if yes is it the fastest way to read/write data on …

Member Avatar for TasostGreat
0
207
Member Avatar for mcamacho07

Here is an ex of a problem I'm having difficutly with. I need to make up a program that does the following: asks user for the number of seconds and the number of miles traveled program should convert the given number of seonds into different units of time in years/days/hours/minutes/seconds …

Member Avatar for Salem
0
565
Member Avatar for bobomicgruvins

I am currently trying to write a program to compute permutations of the array [0,1,2,3,4,5], I need to save all the permutations to another array and I also need the first digit, 0, to be fixed. I have searched through quite a bit of literature on doing this, however I …

Member Avatar for Salem
0
223
Member Avatar for phoniel

Hey - I'm new asking questions here. I'm writing a simple program to give a number to a power using a recursive function (inconvenient, but that's the assignment). It seems as though the program should work, and debugging shows that it almost does. It has the right value up until …

Member Avatar for devnar
0
135
Member Avatar for integer*09

Hi all, Currently, i'm having a window to show rows of data. the following is for 1st row: [ICODE]a0_1->Text = "blah,blah"; b0_1->Text = "blah,blah"; c0_1->Text = "blah,blah"; d0_1->Text = "blah,blah"; e0_1->Text = "blah,blah"; ...............[/ICODE] And as for the 2nd row, its just a change for the last integer of the …

Member Avatar for integer*09
0
87
Member Avatar for tomtetlaw

how do i make a macro saying that the platform is windows? like this: [code=c++] #ifdef WINDOWS //this is the one i am talkin about #include "windowsHeader.h" #else #include "linuxHeader.h" #endif [/code]

Member Avatar for Narue
0
47
Member Avatar for Clockowl

Hey guys, I was wondering... I always assumed that references were more or less constant "dereferenced" pointers. With that in my mind I tried to do this: [code=cpp] #include <iostream> #include <string> using namespace std; void outputIt(const string * const textz00rs){ cout << *textz00rs << endl; } int main(){ outputIt("window"); …

Member Avatar for Narue
0
263

The End.