49,761 Topics

Member Avatar for
Member Avatar for Kilo

This is what I have on my program so far. I do not know what to do next. Thanks alot, Kilo // Write a program to help a local restaurant automate its breakfast billing //system. Show the customer the different breakfast itmes offered by the //restaurant. Allow the customer to …

Member Avatar for Bench
0
141
Member Avatar for Acidburn

Hello 2 questions, when you've got this: [code] char * array = new char[20]; [/code] creates a dynamic array of 20, if on run time the array needs to be 40 how could this be accomplished? I've thought i'd fill the array and if the next element that requires adding …

Member Avatar for Narue
0
108
Member Avatar for amen

need some idea from to find the same word in text file example i had a list of word in text file,let me name it noun.txt..contain noun word..the file contain like this walk run eat drink .... give me an idea how can i find word eat in the noun.txt …

Member Avatar for Bench
0
265
Member Avatar for bops

Hello again everyone, Im having trouble with this function for saving a file from a richedit control within a child window in my application. I have put in extra messageboxes etc to helo me find the error. when I implement this function with valid parameters I recieve the "Invalid handle …

Member Avatar for WolfPack
0
376
Member Avatar for znx

i want to use that in a snake game, i made the snake move but i can't control him .... ...how can i read a key without stoping the looping... if i use getch() it stops till i stroke any key...and the snake stops,then after i press another key makes …

Member Avatar for znx
0
142
Member Avatar for amuarica

Hello, i have a problem with the C++. Below is the code. When compile, there is an error. error C2466: cannot allocate an array of constant size 0 Can anybody answer me? #include <iostream.h> #include <string.h> class samp{ int a; public: void set(int n){a=n;} int get() {return a;} }; int …

Member Avatar for WolfPack
0
103
Member Avatar for amen

i need to write a code on how can break a sentence into word and find out the word belong to. example : when user input a sentence cindy walk slow. 1.break the sentence into cindy,walk,slow. 2.get each word belong to and display. - cindy is a noun - walk …

Member Avatar for amen
0
538
Member Avatar for JoBe

Hello ladies and gents, There's an exercise, well, more a question that goes like this in Accelerated C++: If the following code is legal, what can we infer about the return type of f? [code]double d = f() [n];[/code] What I can gather is that the return type will be …

Member Avatar for JoBe
0
554
Member Avatar for kryptolite

hi guys, i wonder how you can can take a string from a particular file and assign that to a variable. for example here is the file named 'isbn.txt' 123-456-789-0 87-345-21-347 09-876-543-21 and my code, as far is i can write it: [CODE] int fromfile() { string filename; ifstream fin; …

Member Avatar for kryptolite
0
128
Member Avatar for sixtysecasasin

I am using VC++. I want to display to the user all data that is stored in an input file and an output file. My input file contains the following so far but will continue to grow as the user uses it: 100.00 123.45 234.56 212.45 Here is what my …

Member Avatar for Ancient Dragon
0
130
Member Avatar for Jon182

Hey guys I am using code that does the following: [code] cin.ignore(); cin.getline(file, 250); ifstream test; test.open (file); if (test.fail()) { cout<<"error"<<endl; exit(1); } ... [/code] The problem is that if a file name is entered that does not exist for example c:\\fred.txt the error message will not appear and …

Member Avatar for Jon182
0
169
Member Avatar for perlsu

When I build my project I get an error in the excpt.h header file. The build error tells me that there is a missing ';' before 'string' at the line in excpt.h that reads extern "C" { Another error is "missing storage-class or type specifiers" and "fatal error C1004: unexpected …

Member Avatar for Ancient Dragon
0
130
Member Avatar for osean

Hi, i've started to use time.h and i'm needing help with something.. basically, i want to be able to return the specified number of seconds in a week/day/hour/minute/second format very similar to that of mIRC's $duration(). I've done it before but I can't remember what I did.. i know how …

Member Avatar for osean
0
167
Member Avatar for ahkeah

im studying C++ and am having a problem with multiplying two arrays of integers. can i get help with setting up a loop that gets the size of the first array and the second array. then multiply the last integer of the second array with all the integers in the …

Member Avatar for ahkeah
0
204
Member Avatar for perlsu

I want to run the visual C++ projects with the command line arguments. How can I give these arguments in project settings? or How can I run these project from command prompt? Thanks!

Member Avatar for WolfPack
0
133
Member Avatar for perlsu

When I run my program, the following error occurs. If anyone knows how to solve this error, pls help me. Thanks a lot in advance. Rgds, perlsu fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794) Please choose the Technical Support command on the Visual C++ Help menu, …

Member Avatar for SpS
0
194
Member Avatar for Alvein

Hi, This is a boring problem, long to explain. I will try to make things simple. There is a C library that has a function with this interface: [CODE]void ne_set_server_auth(ne_session *session, ne_request_auth callback, void *userdata);[/CODE] Where ne_request_auth is declared this way: [CODE]typedef int (*ne_request_auth)(void *userdata, const char *realm, int attempt, …

Member Avatar for Alvein
0
149
Member Avatar for muthuivs

I need to change all the chancters from a string to uppercase. the toupper() function only works for charachters but not strings. My program looks like this: int main() { string myString; cout<<"Enter the String : "; cin>>myString; myString = toupper(myString); //this doesnt work, i guess since its not char. …

Member Avatar for beuls
0
252
Member Avatar for Acidburn

Hello, I've got a function that returns a memory addres of an array. However making the char * static seems to be the only solution. However it since its static it doesnt get cleaned out so everything is kept. [code] #include <iostream> // cout << endl ... #include <fstream> // …

Member Avatar for Narue
0
273
Member Avatar for JoBe

Hello ladies and gents, I had to do the following exercise: Write a (1)function that reads words from an input stream and stores them in a vector. Use that function both to write programs that (2)count the number of words in the input, and to (3)count how many times each …

Member Avatar for JoBe
0
108
Member Avatar for murschech

Calling all Dev_C++ users, Here's a mystery! The following little program, which determines whether one integer is a divisor of another or not, compiles and runs fine using Borland's bcc32. [code] #include <iostream> using namespace std; bool divides(int,int); main() { int a,b; char ch; cout << "Enter a then b: …

Member Avatar for jwenting
0
101
Member Avatar for muthuivs

Does anyone know how to get a c++ program to output to a usb printer or at the very least an acrobat distiller? I am trying to use the following: ofstream print; print.open("lpt1:", ios::out); print<<"blah blah blah"; but I guess I have a usb printer and not a lpt1 printer. …

Member Avatar for muthuivs
0
2K
Member Avatar for muthuivs

I have the logic all figured out for a nes program that will spit out labels with unique charactrs on it...Almost like barcodes, but nothing that fancy. My stickers will have something like this: ABCGIU101.DFF Like I said, I have the logic but I am not sure how to start …

Member Avatar for dwks
0
563
Member Avatar for xjim72

I am having trouble with an exercise of finding how many times a number appears in an array and display the value and the count of times it appears in the list. The array can be the size of 100.

Member Avatar for xjim72
0
886
Member Avatar for dreamreaver

Hi I have this error..can someone Please help me to solve it?? The coding works on my friend's pc though... [code]#include <iostream.h> #include <cstring.h> struct program { int employee_id; int salary; int eval; string name; }; // Use constants for Arrays Sizes like below. const int NUMBER_OF_EMPLOYEES = 2; const …

Member Avatar for SpS
0
157
Member Avatar for midwesternstyle

I am having trouble implementing a type def in a header file and using the same typedef in a source file (.c). Any help would be appreciated. Also, I can't get a sum function to work, for when i want to sum the numbers pressed on a keypad( i would …

Member Avatar for midwesternstyle
0
144
Member Avatar for ultimate_fusion

i have downloaded the sdk directx9 and installed and put the lib and include files in the dev-c++ directory. I have adjusted the compiler options and I still get 100 errors. e.g redefinition of struct D3DVECTOR and C\devcpp\...\d3d9.h, in file included from C\devcpp\...\d3d9.h any ideas???

Member Avatar for dwks
0
110
Member Avatar for Acidburn

hello ive got 2 arrays defined below char RW[100]; char array[80]; ive got this algo for now but not 100% certain its working [code] void setI(char array[]) { cout << "now in seti function" << endl; for (int j = 0 ; j <=sizeof(RW[j]); j++) { for (int i = …

Member Avatar for dwks
0
87
Member Avatar for sosy2001

This is my assignment: > Step 1.Create a structure with the name StudentRecord containing a Name stored as an array of 20 characters, an ID stored as an integer, and a GPA stored as a floating integer. Create (instantiate) a variable from StudentRecord called TESCStudent. > > > > Step …

Member Avatar for dwks
0
127
Member Avatar for fevershark

how can i use a class and dynamically allocate memory for an array? my class is called Fraction. [CODE] int n; /* n holds the user input */ int *array; /* array which you want to allocate later */ cout << "Enter the number of array elements..."; cin >> n; …

Member Avatar for dwks
0
144

The End.