49,761 Topics

Member Avatar for
Member Avatar for Passiongamer25

I have a problem with my program and it has to do with my finding average function. The program goes like this: The program will grade a series of exams and then print a grade report for students in a course. Input: An instructor has a class of students each …

Member Avatar for Passiongamer25
0
177
Member Avatar for delerium12345

I'm having a lot of problems writing a program to open a file listing the grades of 4 students, all listed next to their names, and outputting an appended version of the file with the average of the scores next to the numbers on each line. it goes something like …

Member Avatar for h3xc0de
0
83
Member Avatar for NexusX

Hello, I'm having a great deal of trouble stemming from a part in my code where I have to convert an integer into a string so that I can concatenate it - the problem being that a variable is refusing to clear or re-write itself, instead it just appends the …

Member Avatar for NexusX
0
115
Member Avatar for VBNick

I have seen functions defined these two ways: function(type *variablename) function(type variablename&) I commonly use the first one to pass on pointers to my structs, but is the second one the same as the first?

Member Avatar for VBNick
0
306
Member Avatar for rosenberg_a

This is my code... [CODE] #include <iostream> #include <fstream> #include <vector> using namespace std; bool searchVect(vector<int>, int); int main() { bool answer; int value; vector<int> vect = {13579, 26791, 26792, 33445, 55555, 62483, 77777, 79422, 85647, 93121}; cout << "Enter the number to determine if there is a winner. \n"; …

Member Avatar for VernonDozier
0
135
Member Avatar for kishore84

Hello friends, Need help in generating a random number from an array.Once a number is generated, the number has to be deleted from the array so that only the remaining numbers can be generated from the array.And it should go on until all the numbers from the array are deleted. …

Member Avatar for VernonDozier
0
3K
Member Avatar for Stefano Mtangoo

Im learning ++ by myself and have decided to follow this tutorial and very interesting [url]http://www.cprogramming.com/tutorial/lesson4.html[/url] However as you can see the int mult ( int x, int y ); is defined twice: at the top and the bottom. Whay it is that. Also I have found many programs uses …

Member Avatar for Stefano Mtangoo
0
143
Member Avatar for serkan sendur

when i try the code below : [CODE]#include <iostream> using namespace std; int a = 3; int b = 4; int c = 5; int * pA = &a; int * pB = &b; int * pC = &c; int * abc[] = {pA,pB,pC}; int main() { cout << abc[*pA] …

Member Avatar for BevoX
0
70
Member Avatar for Nikhar

Hi...this is the code that I wrote to find a particular string from a 2-d array of characters. It prints F(for found) and N(for Not found). When I execute this program, it prints N only. [code]#include<iostream.h> #include<conio.h> char SearchString(char[5][10],char[10]); void main() { clrscr(); char str1[5][10],str2[10]; int i; cout<<"\nEnter 5 objects:-"; …

Member Avatar for Nikhar
0
132
Member Avatar for mcnally

[code] // gettingEvenNumbers.cpp // Purpose of this functions is to read in the numbers 1 - 20 // and print out only the even numbers using a loop of some kind. #include <iostream> #include <string> int main() { // Numbers being used. int x[] = {1, 2, 3, 4, 5, …

Member Avatar for mcnally
0
95
Member Avatar for appy33

I would like to learn C++, Everytime I write the code or should I say copy the code down, I get to where I want to compile but cannot get the program started. Can any one help by explaining how after I copy the code the steps from then on. …

Member Avatar for Freaky_Chris
0
196
Member Avatar for tuttie

I am working on a programm that requires one to write a program that outputs your first and last intials in block letters. The block letters should be made up of small letters that match your block letter. If PS is the block letter then p should be made up …

Member Avatar for tuttie
0
953
Member Avatar for mauro21pl

Hi to all I have a quick question. I am going to fill an array with some inpuit of type char using member function cin.getline. After I fill an array ,I would like to do "for" loop so I need to know what is curently the size of an array. …

Member Avatar for Narue
0
137
Member Avatar for serkan sendur

hi, in the code below : [CODE]#include <iostream> using namespace std; struct deneme { int a; void (* myFunction)(int a); }; void function1(int a) { cout << a << endl; } void function2(int a) { cout << a + a << endl; } int main() { deneme myDeneme[] = {{1,function1},{2,function2}}; …

Member Avatar for serkan sendur
0
103
Member Avatar for Soleng

I would like to have a singleton class along the lines of the Meyer's Singleton but which is private to a single thread. The singleton should automatically destroy itself when the thread dies. Any suggestions are appreciated! Harald

Member Avatar for _adam_
0
507
Member Avatar for dhpatil1

Hi all, I am working on vs2005 (vc++8). I have created one dll in vs2005(vc++8), in that we have one function which returns "std::string" . when i load this dll in another vs2005(vc++8) application and call the function which returns "std::string", we get following error: Windows has triggered a breakpoint …

Member Avatar for jencas
0
210
Member Avatar for chrischavez

i Wrote some basic code on something i saw here i while ago and was wondering what people could do with it. it uses a console and you can draw on the console or the entire desktop. i was hopping there was thing people could do to add or improve …

Member Avatar for Freaky_Chris
0
1K
Member Avatar for krnekhelesh

I am making this program which checks if your floppy drive is ready or not. And so it has to check for say 20 seconds. And for this I want the program to run in the background. How do I do this? I am using Borland C++ and Turbo C++

Member Avatar for EZO
0
1K
Member Avatar for CPPRULZ

When a parameter in a function definition (for say class distance) is abc(distance a) and in the main you call this function and pass distance b, what is the relationship thereafter between distance a and b? Do there adresses become equal-if so what implications does that have in the program?

Member Avatar for CPPRULZ
0
115
Member Avatar for Ontonyx

Ok, This program is designed to output sides and angles of a triangle based upon a side and angle that is inputted by the user. When I run the program the lenghts of the sides that I receive make absolutely no sense..but when I do them in my calculator they …

Member Avatar for VernonDozier
0
125
Member Avatar for Ontonyx

Hi, I have written the below code and to finish my assignment I need to have this file save to "results.txt" and I also need the angles to come out as degrees in the output..I've tried several tutorials and I am really struggling with this..any help would be appreciated [code] …

Member Avatar for VernonDozier
0
100
Member Avatar for CPPRULZ

Hello I was researching the copy constructor and found this exampleo a website: [code=C++] #include <iostream> class Array { public: int size; int* data; Array(int size) : size(size), data(new int[size]) {} ~Array() { delete[] data; } }; int main() { Array first(20); first.data[0] = 25; { Array copy = first; …

Member Avatar for CPPRULZ
0
90
Member Avatar for serkan sendur

in C# if you add @ before your string literals the escape sequences are not processed, so : you can use : [CODE] @"c:\Docs\Source\a.txt" // rather than "c:\\Docs\\Source\\a.txt"[/CODE] is there any c++ equivalent of doing that? Thanks

Member Avatar for cikara21
0
160
Member Avatar for tones1986

Hey all. I have worked on this in a previous post, but because of the huge difference in work needed, i have reposted it here. First off, i created a project that would input data from keyboard of a student, this student had name,ssn,dob,school id information that was needed. After …

Member Avatar for tones1986
0
106
Member Avatar for number87

Hi guys I just wanna ask what is the difference between the mode_t and st_mode when using sys/stat.h and sys/types.h libraries. I looked them up google and find most people use st_mode but never mode_t.

Member Avatar for number87
0
95
Member Avatar for abby2589

fatal error C1004: unexpected end of file found what is that problem when this error shows?? what do i need to do?

Member Avatar for CrimsonTider
0
57
Member Avatar for CrimsonTider

Hey guys, I'm new to the forum and pretty new to C++. I think I'm just about finished with this project, but I've run into a couple problems. Here's my assignment: "Write class Lib and modify class Book such that this [URL="(http://cs.ua.edu/124/Spring2009/Projects/main.cpp)"]main[/URL] works as implied. For each class create .h …

Member Avatar for CrimsonTider
0
236
Member Avatar for christiangirl

Hey, So I got this program all working except some of the output is weird pictures instead of letters. The first time it outputs it works fine, but after that it only partly works. Here's the code: [code] #include "queue.cpp" #include <iostream> #include <fstream> #include <iomanip> /******************************************* * class Priority …

Member Avatar for christiangirl
0
151
Member Avatar for soroushc

It's my assignment I have done almost I have completed it.But I have problem in getting input from user(the bank name)here is my assignment question. Customer often wait in the bank..!you have to ask the user the entire as many bank names as he desires and time (waiting time the …

Member Avatar for Stefano Mtangoo
0
162
Member Avatar for neoangin

Hi, I am trying to implement some code from MS VS 2008 Documentation. [QUOTE]To enable the user to draw filled shapes, include the following popup menu in your application.[/QUOTE] [CODE] POPUP "Filled &Shapes" { MENUITEM "&Ellipse", IDM_ELLIPSE MENUITEM "&Rectangle", IDM_RECTANGLE MENUITEM "R&oundRect", IDM_ROUNDRECT } [/CODE] I put in header: [CODE]#define …

0
54

The End.