49,761 Topics
| |
[code] NODE *head; public: void push(int value){ NODE *temp = (NODE*) new NODE; temp->value = value; temp->link = head; head = temp; }//end of push. void pop(int&value) { NODE *temp = head; value = head->value; head = head->link; delete temp; }//end of pop. int is_empty(void){ return head == NULL; }//end … | |
[CODE] // absolute.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include<iostream> #include<string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int i=0, j=0,k=0,l=0; string yes1;bool outcome;int u=0,v=0,w=0; string arr[4 ][4]={{"Name","Plot #", "Cost", "Address"}, {"john", "1121", "Rs.1000", "62 johar TOWN LAHORE"}, {"jonty", "1123", "Rs.100000", "56 … | |
// absolute.cpp : Defines the entry point for the console application. // [CODE] #include "stdafx.h" #include<iostream> #include<string> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int i=0, j=0,k=0,l=0; string yes1;bool outcome;int u=0,v=0,w=0; string arr[4 ][4]={{"Name","Plot #", "Cost", "Address"}, {"john", "1121", "Rs.1000", "62 johar TOWN LAHORE"}, {"jonty", "1123", "Rs.100000", "56 … | |
I have to take this program and make a header file, and implementation file, and a driver file. I wrote the original code and with all of the couts int the functions I can only put one function into an implementation file. [CODE] #include <iostream> #include <iomanip> using namespace std; … | |
//use nib in Nibbler to set nib1, nib2, nib3. How the Nibbler and ABC get more efficient to send the Nbytes in ABC?. [CODE]union ABC { unsigned char Nbytes[4]; struct { unsigned short nib1 : 4; unsigned char NA1 : 2; unsigned short nib2 : 4; unsigned short nib3 : … | |
Currently having trouble completing my code homework for my class. Help would be greatly appreciated. Write a menu-driven C++ program to manage employee data. Your program should begin by reading in a file of employee information (filename employdata.txt). Each data line contains the following information: {hire date} {employee ID} {salary} … | |
Without the complete context to summarize: [CODE] #include "stdafx.h" #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <objbase.h> using namespace std; BYTE* StringToGUID(LPOLESTR szBuf) { GUID *g = (GUID *) malloc( sizeof(GUID)); HRESULT h2 = CLSIDFromString(szBuf, g); return (BYTE*) g; } [/CODE] I Get: 1>Linking... … | |
I have written the program which fills an array of structures and then writes that array to txt file. The problem is that my program terminates in unusual way on windows vista command prompt line but dev-C++ shows no errors when compiles. I think that is related with the number … | |
The following code is supposed to read records from input and store them in a file called file.dat. Then it is supposed to arrange these records in ascending order, but for some reason the program hangs at line no.61. Can someone please tell me what's wrong? #include <iostream> #include <fstream> … | |
I have written the following code to try to get my GPA calculator program to work. I am not allowed to use arrays. I only know what I am doing from the videos I have watched on youtube and the slideshows that we get from our instructor. Unfortunately, the slideshow … | |
hello guys, im having trouble on how to approach this assignment i have for my c++ class, please i would appreciate all kinds of help and advices. thank you in advance. The game is a one to three players dice game. At the start of the game there are nine … | |
Hello, I need some advice on how this function outputs the left zeros so everything will be even at 16 bits [CODE]string conv (int num, int base) { if (num == 0) return "0000000000000000"; char NUMS[] = "0123456789ABCDEF"; string result = ""; do { result.push_back (NUMS[num % base]); num /= … | |
Hi im currently doing some work with arrays and ive been working on this program. The goal is a user can add up to three products. Each product will have a name, model number and price. Once all is entered a list will pop out showing all the products with … | |
Hi, I'm a beginner in C++ and working on my lab assignment. I get the following error, please help. Thanks, Skyline error C2676: binary '+=' : 'Time' does not define this operator or a conversion to a type acceptable to the predefined operator // Function - CalculateTotalCollectionPlayingTime() Time MediaCollection::CalculateTotalCollectionPlayingTime() { … | |
Why does my delete function crash? I've used the same algorithm for other 2D vectors and it works perfectly fine.. I'm trying to remove an array of vectors from a 2D vector all of the std::string type. [CODE] //Ripped out of a massive class I wrote. vector<vector<string>>& Delete(vector<string> StringArrayToDelete, bool … | |
I wrote a simple program to take input till the char array is filled up. But i seem to be getting a problem during runtime that the program takes input continuously and never stops. Pls help in identifying the problem.(there were no errors during compiling) [CODE] #include<iostream> #include<string> using namespace … | |
I need help with this code Constructer is abnormally called again n again.... add these file 2 a project n run ...i've given given constant messages in da code to explain the problem! Hit (1) two tyms i.e GetInput function in da menu.... u'll get 2 knw wat da problem … | |
I am trying to compile NeHe code for win32 app in visual studio 2010. but this error appear: [CODE]cannot convert parameter 2 from 'const char [29]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast[/CODE] to these instructions [ICODE] if (!wglMakeCurrent(NULL,NULL)) // Are … | |
Hi everyone, I have written this code which can find the square root of a positive number using newtons method. The code below describes it all. Now, I just need to know how can I show each iteration of the loop? like I wanna out each iteration until the final … | |
I'm not sure if this is the best place for this thread, but it's the best I could come up with. I'm using a QT Style Sheet to style a radio button like this: [CODE] QRadioButton{ background:#5F7536; color:#CBF57D; font:bold; } [/CODE] It works fine except that in addition to changing … | |
please m I want help , I am a new member I dont know How I use this site , I attached some problem and I want help :) | |
Now before you give me a knee-jerk "do your OWN homework we-won't-help-you-cheat" reaction, please read this all the way through. My homework assignment is to write a Caeser Cipher (from my understanding its very common for professors to give this assignment) and I have that done (with some help from … | |
I have to find factors of 1-10 then count all factors and find if they are odd/even. I know how to find if they are even or odd i just can't count how many factors for each number. #include <iostream.h> #include <stdlib.h> int main() { int num, icntA, icntB, icntC, … | |
Hi all I have a list of 20 numbers and I have to write a program that takes the first 3 numbers, calculate the median and shoots out the median in table format. Then the program takes numbers 2,3,4 and calculate the median and shoots it into a table. Then … | |
Hi, I have made some sorting function based on finding largest element and swapping its place with last element of array and then searching largest element of rest of array and putting it on one place before last one and so on. I am curious about is there a name … | |
So, I'm back once again. This week I'm having issues with efficiency in a Radix Sort Algorithm. From what I understand this is the foundation of this algorithm. What operations might be costing me? For the basics I suppose I do understand push_ back being costly having to copy the … | |
I am getting an access violation. Can anyone see why this might occur in the following code fragment from a GUID generator? [CODE] // here is a code fragment fro a GUID creation routine. // it is crashing with an Access violation #include <iostream> #include <fstream> #include <string> #include <stdio.h> … | |
I am interested in changing my major in college and also making a career switch, I would like some advice if anyone can provide it, I'm not super smart nor do i know too much about computers but i work with them as an AutoCAD Tech for an engineering firm … | |
So im using the source code off a tutorial to learn and add a feature to drop a block. Ive learned so much so fra but now ive come to a dead end! You move with the arrow keys- works You press space to show the block- doesnt work heres … | |
So the function: [CODE]glLoadIdentity();[/CODE] resets the matrix, so for instance we do this: [CODE]glMatrixMode(GL_PROJECTION); glLoadIdentity();[/CODE] how exactly does this work, it seems that we set the matrix and then just return it to the way it used to be. |
The End.