49,761 Topics
| |
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 … | |
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 … | |
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 … | |
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? | |
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"; … | |
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. … | |
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 … | |
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] … | |
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:-"; … | |
[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, … | |
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. … | |
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 … | |
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. … | |
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}}; … | |
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 | |
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 … | |
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 … | |
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++ | |
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? | |
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 … | |
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] … | |
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; … | |
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 | |
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 … | |
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. | |
fatal error C1004: unexpected end of file found what is that problem when this error shows?? what do i need to do? | |
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 … | |
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 … | |
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 … | |
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 … |
The End.