51,593 Topics

Member Avatar for
Member Avatar for JoBe

Hello ladies and gents, Ive been trying to find a solution for this exercise wich goes as follows: Rewrite the Student_info structure, and the 'read' and 'grade' functions, so that they calculate each student's grades as part of reading the input, and store only the final grade. Because the exercise …

Member Avatar for JoBe
0
187
Member Avatar for HackWizz

Hi... m a new member n just started to learn c++. so please help me out... its simple I read in 1 of the replies that #include<iostream.h> is obsolete.... n one can use #include<iostream> But wen i tried it in d program it does not included file.. expectin replies... :twisted: …

Member Avatar for HackWizz
0
211
Member Avatar for sixtysecasasin

Is there a code to increase the console window so that the user does not have to do it manually? I am using VC++ 6.0

Member Avatar for shortLived
0
141
Member Avatar for Jon182

Hey guys I was just wondering is there a c++ function that will eliminate white space from the start and end of a character array data obtained with the getline function? Thanks.

Member Avatar for Narue
0
158
Member Avatar for sixtysecasasin

I am writing a program and I want a graphic to show up when the user first starts my program. I know how to implement it, the problem is that I want to show a graphic totally made up of ASCII art. The problem is that it has a lot …

Member Avatar for Bench
0
178
Member Avatar for Acidburn

Whilst I shouldnt have posted the entire code up, I see no other option :( [code] #include <iostream> // cout << endl ... #include <fstream> // for reading in the file ... #include <string> // for comparing strings ... using namespace std; string reserveWordTable [4]= { "if", "then" , "else", …

Member Avatar for Rashakil Fol
0
142
Member Avatar for amen

can anybody give me an idea how to sort string in alphabetical order in file.text after user input string and in the file already had a list of string? which is the best,let user input the all string first then sorting it or sorting if after user input the string? …

Member Avatar for Ancient Dragon
0
111
Member Avatar for lilprincss10881

Can't figure out why I have the error...The error is: C2181: illegal else without matching if....My program is: #include <iostream> using namespace std; int main() { int x=300; //this is the room capacity int y=0; //number of people int z=0; //this is the equation answer int m=0; //this is the …

Member Avatar for WolfPack
0
80
Member Avatar for Jon182

Hey guys, I am using the code below ot search for words in a text file and count them. I now would like to do something a little more advanced for example if a text file contains "hello my name is kim" I want to be able to increment a …

Member Avatar for Bench
0
241
Member Avatar for akshayabc

Hi friends!!!!!!!!!! I am taking part in Red hat competition to develop a linux project. I am not able to decide on what shd i do the project. In 1 group there r 3 ppl and we have around 8 months time, it includes 2 months vaccations also. I want …

Member Avatar for Narue
0
919
Member Avatar for shortLived

I have this assignment from my book that wants me to create a class and have its member variables be dynamic. This is easy to do but I can't understand why I would want to, and don't see any advantages of having the members be dynamic. Personally I would create …

Member Avatar for shortLived
0
176
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
143
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
111
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
277
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
397
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
145
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
107
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
543
Member Avatar for crusty_collins

Hey, I am a newbie to all of this so please don't flame me for a stupid question. I am trying to write a shared lib that will initialize a connection to a messaging deamon. Then the library will be called at intervals and send data. My problem is that …

Member Avatar for crusty_collins
0
111
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
559
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
130
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
135
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
171
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
132
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
171
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
208
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
199
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
152
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
253
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
275
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
112
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
105
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
585
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
888
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
160
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
147
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
111
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
91
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
131
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
146
Member Avatar for tyczj

cant figure out this error. im trying to do a 3 dimensional static array that just displays the number in a matrix form ex: 1111111 1111111 1111111 im sure the error has somethin to do with the depth, row and col being constants but i dont knwo how to fix …

Member Avatar for dwks
0
153
Member Avatar for Acidburn

[code] #include <iostream> #include <fstream> using namespace std; char RW[10]; char id[10]; void populateArray(char ch, int &i, char * array); void valid(char *array, int i); #define MINUS '-' #define PLUS '+' #define TIMES '*' #define DIVIDE '/' #define EQL '=' #define LP '(' #define RP ')' #define SEMIC ';' #define …

Member Avatar for dwks
0
119
Member Avatar for Jon182

Hey guys, I have made a C++ console program and I was just wondering is there anyway to give the exe file a logo rather than just having the standard white box? Thanks in advance for any advice given.

Member Avatar for Jon182
0
137
Member Avatar for Acidburn

[code] //parsing (a,d,n) #include <iostream> using namespace std; char getsym(); void L(char sym); void C(char sym); void c(char sym); int main() { char nextsym; nextsym = getsym(); cout << nextsym; return 0; } char getsym() { static char array[20] = "(a,d,n)"; static int i = -1; ++i; return array[i]; } …

Member Avatar for iamthwee
0
126
Member Avatar for Cooberman76

Hi there everyone. I'm new to the boards (and C++ as well) :confused: I was wondering if someone out there would be so kind as to guide me or explain the best way to handle this dilemma I'm having. I''ve spent a full week coding my programming assignment for this …

Member Avatar for vegaseat
0
169
Member Avatar for parvin2

how can I place all of my program in a while loop what I want is this: the user should enter color of pen ,color of brush and then enter name of a shape that want to draw. my program should give this information and draw a shape the user …

Member Avatar for Nedals
0
176
Member Avatar for sladesan

I would like to note that this is for John Conway's game of life but I must write it in C++. I am making a 10x10 version of the game and I am using jGRASPto write the code. I am having a problem when it is reading in the starting …

Member Avatar for Lerner
0
862
Member Avatar for cesarmas

I tried to make a function , using iterators, to walk a deque backward and my function does not work . I would appreciate if somebody cna help me : double Dq_Iter_Backward() { deque<int>::reverse_iterator InvDeqIter; DeqIter=intdeq.begin(); InvDeqIter = intdeq.end()-1; for(InvDeqIter = intdeq.end()-1;InvDeqIter!=intdeq.begin()-1;--DeqIter) { cout<<InvDeqIter; } elapsed = clock()- start_time; elapsed_time …

Member Avatar for Lerner
0
181

The End.