49,761 Topics
| |
part of the code [CODE] string phone_book[11] = {"Becky Warren, 678-1223", "Joe Looney, 586-0097", "Geri Palmer, 223-8787", "Lynn Presnell, 887-1212", "Holly Gaddis, 223-8878", "Sam Wiggins, 486-0998", "Bob Kain, 586-8712", "Tim Haynes, 586-7676", "Warren Gaddis, 223-9037", "Jean James, 678-4939", "Ron Palmer, 486-2783"}; int x, index; char lookup[50], *strPtr = NULL; /********************************** … | |
The program is suppose to output all the prime numbers between 3 and 100. It acutally outputs all numbers between 3 and 100. My code is as follows: [code] #include <iostream> using namespace std; int main () { int number=3, count=2; while (number <= 100) { if ((number % count) … | |
I was wondering which would be better to use for the allocation of memory. The memory that is being allocated will almost certainly have to be reallocated several times. I am making a string class (how original :) and I am going to give it dynamic memory allocation (whether or … | |
Can any1 tell me about the tutorials and description regarding new c++ standard. specially the improvement in STL. | |
Hello all, this is my first post. My problem is with division and/or the way i am declaring variables. here's my code: [code=cplusplus] #include <iostream.h> int main () { int minutes; float hours; float minutes_late; cout << "How many minutes late are you? " ; cin >> minutes; hours = … | |
How are an object’s data members initialized if a class has only an implicitly defined default constructor? And why a class might provide a "set" function and a "get" function for a data member? What is the purpose of the scope resolution operator? | |
Hello there, I've been messing around with threads these days. Currently, I'm having problems with one of my variables of type [B]pthread_cond_t[/B] (let's call it variable [B]Z)[/B]. I made a class (let's say class [B]X[/B]) , and you guessed it right, [B]Z[/B] was declared in it with private access level. … | |
The program I'm doing randomly generates 10 numbers per group. While there will always be 10 numbers in each group, how many groups are to be made is user-specified and is thus static. I can generate the numbers from the userinput just fine, I ran a test and had it … | |
I've read 4 consecutive bytes from a binary file, and store the value as follows, [CODE] int main() { char next4[4] ; while(!fileopen.eof()) { fileopen.read (next4, 4 ) ; } } [/CODE] What I want to do is, that value in next4 want to convert into a decimal/int value. How … | |
I have a binary file, contain set of stream, and I want to find some information there. What I have done up to now is read the file, open it and count the number of streams three. I'm stuck now. Just consider one stream. I want to skip first 4 … | |
Okay, so i've gotten some help, however i'm still missing some things. In the code below, I have a Bowler's name, and their score. [code=cplusplus]#include <iostream> #include <string> using namespace std; int main() { string names[3] = {"John","Anne","Mary"}; int score[3] = {5,1,2}; //i.e //John's score = 5 //Anne's score = … | |
How can I make this print the text in the edit box when you push the button instead of "You pushed a button." I have looked all over but I can't figure it out. [CODE] #include <windows.h> #include "resource.h" HWND hWndButton; HWND hWndEditBox; HFONT hFont; /* Declare Windows procedure */ … | |
im trying to creat a class called Date that includes data members: a month, a day and a year (all type int). that have a constructor with three parameters to initialize the three data members. i have to use a set and a get function for each data member and … | |
[code] [COLOR=green]#include[/COLOR][COLOR=green]"stdafx.h"[/COLOR] [COLOR=green]#include[/COLOR][COLOR=green]<cstdlib>[/COLOR] [COLOR=green]#include[/COLOR][COLOR=green]<iostream>[/COLOR] [COLOR=green]using[/COLOR][COLOR=green]namespace[/COLOR][COLOR=green] std;[/COLOR] [COLOR=green]int[/COLOR][COLOR=green] tmain([/COLOR][COLOR=green]int[/COLOR][COLOR=green] argc, _TCHAR* argv[])[/COLOR] { [COLOR=green]// Let's Declare Variables[/COLOR] [COLOR=green]int[/COLOR] Num_Pegs; [COLOR=green]// Total number of pegs to a side[/COLOR] [COLOR=green]int[/COLOR] Hold_Und; [COLOR=green]// Hold underscore location[/COLOR] [COLOR=green]// User Enters Number of Pegs[/COLOR] cout <<[COLOR=green]"Enter Number of Pegs:"[/COLOR]; cin >>Num_Pegs; [COLOR=green]// Array to create a … | |
I am a complete newbie to c++ and I am trying to find some tutorials. What I am trying to do is use a variable (from external text file) to rotate a 3D object. Then for the program to take a picture of the position the 3D object is in. … | |
I got this requirement wherein i have to program the different cpu algorithm namely FCFS, SJF and Round Robin..but i dont know how to make a round robin.. please help me with it..i need it tommorow:( here's my requirement..Link: [url]http://www.4shared.com/file/24492109/a3069b64/ALGO.html[/url] if there is a problem with the link please contact … | |
I have an assignment due tomorrow, my professor hasn't taught the class much of anything other than what other careers there in the programming field and how other careers differ from programming. He hasn't been of much help at all and I'm at a total loss of how to start … | |
Hello I need help in converting char * to TByteDynArray in Borland C++ Builder. Below code is suppose to work but it give me EAccess Voilation error. [code=c++] char *one = "test"; TByteDynArray two; two.set_length(sizeof(one)); Move((void *) one[0], (void *) two[0],sizeof(one)); [/code] This kind of code work in delphi and … | |
I am currently enrolled in a course doing OO with C++ at college. I have been assigned an assessment where using Visual Studio and DirectX, create a game of basically any sort of difficulty but I must use all aspects of OO. I have an idea of what game sort … | |
hey everyone, im new, and i have a simple question. im writing this basic code for my class to input six different check amounts, then give the total and average. so far i have it so it works perfect with whole number. the only problem is, the numbers i need … | |
i am new to programming and am trying to do a weird assignment. Here are my instructions: There is a drive-thru Car Wash that offers different services. 1) Regular Car Wash 2) Super Car Wash 3) Super Dooper Car Wash 4) Quit The fee for each one of these services … | |
| I am running Ubuntu and compiling my C++ code using g++. For some reason I can't get it to compile my source code using VOID MAIN. It is always telling me that I must use INT instead. This isn't life threatening, but I was just wondering if g++ just doesn't … |
Hi All, The problem is that i have to read in a text file which is something like: ASt BSt BSt WSt BSt YeSt BSt KrSt MSt KrSt they are possible street intersections from ASt to MSt. I have to output the list of streets in order to reach MSt … | |
Hey can anyone tell me how to make a program that i can have a cmd in the cmd to exacute over and over waiting 1 minute each time? | |
How do you read values from a file you created, to print it in an array to create a frequency? | |
Hey guys, I keep getting a link error in my code. It says this: [code]1>prob4.main.obj : error LNK2005: "private: static int HotDogStand::totalSales" (?totalSales@HotDogStand@@0HA) already defined in prob4.func.obj[/code] Here's my code, maybe someone can help me out. [code]#pragma once #include <iostream> using namespace std ; class HotDogStand { public: HotDogStand ( … | |
The assignment was to graph a line within 10 units of the origin after the user inputs the slope and y-intercept. Sounded much easier than it was, I gave it a shot but I can't get it to print correctly. To be honest I just dont know if im headed … | |
| Hey guys, I'm trying to make a linked list in C++ such that: it creates a node for each student in a classroom, AND that each student has it's own 4 nodes for their 4 test grades. I've created two structs - studentNode, and gradeNode studentNode containing "name" and "*next" … |
I did vector calculation like blow. Here I just use 2 vector addition C =A1+A2 But, now I want to add many vecters like A1+A2+...+A35 Is there any simple method beside ( I don't want to type continuously like A1,A2,A3,A4.....A35) ex) void sum(vector<long double>& C,const vector<long double>& A0,const vector<long double>& … | |
Was compiling homework problem with Dev-C++ and got ]Linker Error] undefined reference to determinant(float, float, float, float, float, float, float, float, float) Anyone know what this is? [code=cplusplus] #include <iostream> using namespace std; float determinant(float, float, float, float, float, float, float, float, float); int main() { float x1, x2, x3, … |
The End.