49,761 Topics
| |
Hi, during the build of my code, i m getting the following error error LNK2001: unresolved external symbol __imp__QueryServiceStatusEx@20 i have included the library file advapi32.lib in project --> settings. but still the error is same. any pointers?? TIA | |
anybody here who could teach me how..or the function on printing an output file in linked list.. | |
Hello, I know that "break" is used to end a loop, but how does one exit a C++ console program, after the user enters a negative value, without using a loop? For example, I would like to do this: if (value == -1) { system("exit");} But the code above does … | |
[code] int main() { cout << "This Program was written by Nehal Shah\n" << endl; int num, total; cout << "Please enter an integer number:\t\t\t"; cin >> num; while ( num < 0 ) { cout << "\t********************************\n"; cout << "\t********** ERROR *************\n"; cout << "\t********************************\n"; cout << " --------------------------------------\n"; … | |
How do do you close an external application after previously running it using shell execute in Borland C++ builderr? | |
What im wondering, is because im making a little text adventure game, and i have to write lots of descriptive writing and i would like it all to stay together in a paragraph. But the only way of getting that on output that i know of is to just have … | |
ok, so I have read some tutorials on file streams, but i am still confused. I have made a program that edits a .txt (inputted by user) file, but my goal is to search an entire file for a string, and every time the string its found, I want it … | |
Hey everyone, I have an assignment to work on and it's a bit confusing. Here's the problem: [quote]Using dynamic arrays, implement a polynomial calss with polynomial additions, subtraction, and multiplication. Discussion: A variable in a polynomial does nothing but act as a placeholder for the coefficients. Hence, the only interesting … | |
How do you incorperate sound files into a C++ program? | |
#include <iostream> #include <cmath> using namespace std; int main() { // Declare constants and variables const double ACCURACY = 0.00001; double x, factorial, ex_approx, ex_funct, curr_term; int terms, i; // Read value of x for exp(x) calculation cout << "Enter the value of x you wish to use for exp(x) … | |
hello all, I'm new to c++ and am currently reading the book "C++ how to program" by Deitel. I'm working on exercise 7.15 from his book and am just stuck with the problem. Use a one-dimensional array to solve the following problem. Read in 20 numbers, each of which is … | |
Please help me im having trouble with a dice roller im making. Its kind of working except i was wondering why it is that every time i start it up it always throws up the same numbers in a row if you put in 100. It probably does that with … | |
for my c++ class we are writing a simon program (the game where you have to remember and follow the pattern given to you). each turn the program outputs either r, b, g or y to the current pattern (output should look like this: turn1: y 2: yg 3:ygy 4:ygyr … | |
I created one Function in VC++(which is COM EXE) which i want to call from my VB code. I am passing Arguements as Variants from VB. In VC++ i filled SafeArray in those Argument.But after returning its showing Empty.. Here is my VB Code Private Sub Form_Load() Dim obj As … | |
I'm trying to write a program for my c++ class that takes binary numbers and converts them to decimal. I have programmed this all fine and dandy, but I'm having trouble with my EOF statement. The program requires that I use 3 functions, the first being to prompt user for … | |
[code=cplusplus] cLass lunch { private: float cost; int calories; public: lunch (); void set cost (float c); void set calories (int c); }; luncn: :lunch () { cost =0.0; calories =0; } void : :lunchdisplay() { cout <<"lunch costs"<<cost<<endl; cout<<"it has"<<calories<<"calories<<"calories"<<endl; } void: :lunch: :setcost (float c) { cost += … | |
I'm working on a simple program. It will compile,but whenever I press the delete button a message pops up and says it needs to close. I looked at the error details and It's error code was 0xc0000005. This is where I think the problem is: [CODE] for(i= 0; i < … | |
NEED help please. here's our code. We wanted to print its output file. what function will we use? how will we do it? .We wanted to add printing in the menu.thanks [code] #include<iostream.h> #include<stdlib.h> #include<conio.h> #include<stdio.h> struct node{ int x; char h[50]; //last name char fn[10]; struct node *next; }; … | |
I have a list view and I'm trying to get all of the text out of it. This is my code so far: [CODE] for(i= 0; i < NumOfItems; i++) { char *text = new char[256]; char *text2 = new char[256]; // mask ListView_GetItemText(hWndListView, 0, 0, text, 256); ListView_GetItemText(hWndListView, 0, … | |
[code=C++]#include <fstream> #include <iostream> using namespace std; char * buffer; long size; int main () { ifstream infile ("d2gfx.dll",ifstream::in); ofstream outfile ("d2gfx.dll",ofstream::out); infile.seekg(0xBD30,ifstream::beg); size=infile.tellg(); infile.seekg(0xBD30); buffer = new char [size]; infile.read (buffer,size); cout << buffer << "\n"; system("pause"); outfile.seekp(0xBD30,ifstream::beg); size=outfile.tellp(); outfile.seekp(0xBD30); outfile.write ("D2Mad.dll",10); delete[] buffer; outfile.close(); infile.close(); return 0; }[/code] … | |
I just started learning about stl.... the problem is that 3 cases that i consider "equivelant", don't do the same thing...so the question is, why they are not equivalent? here are the statements: [CODE]cout<<(char)toupper(*pos)<<" "; //this works![/CODE][CODE]cout<<toupper(*pos)<<" "; //without cast it doesn't work, why?[/CODE][CODE]*pos=toupper(*pos); //and this also doesn't work cout<<*pos<<" … | |
I need help with this problem, ok so I am making a program for my brother that randomizes 2 things, a Number(1-6) and a Letter(A-E), I go for the randomize 2 numbers, one for the number, and one for the letter. So i was going very well, until I compile … | |
Okay, so the premise is that this place contains items for sale, and has five of everything that it sells. The inventory is brought in from a file and with parallel arrays you set up the item names with the inventory in stock. I have that all down, but now … | |
i have written my homework problem but get 7 errors in it. the errors seem to be comming from this line as well as others like it. any help would be greatly appreciated. this is my first year doing this and is somewhat confusing. I need these lines to be … | |
Can someone tell me what i'm doing wrong: [code]#include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { const int MAXGRADES = 5; int i, grade[MAXGRADES]= {0}, count = 0; double Avg, sum = 0; for (i=0; i < MAXGRADES; i++, count++) { cout << … | |
Having some trouble with my number guessing game. The object is that the user thinks of a number between 1 and 100 and the computer tries to guess it in a set number of tries. The user inputs an "l" or an "h" if the guess is too low or … | |
i dont understand what the function "flush" does please answer and one more, is there a way that we output a set of data only after a certain while in program execution without storing it in a file and again printing it after reading from that file eg.... i declared … | |
I am working on a windows XP system. I am doing a command line compile and link using a makefile. It works except for the fact that it cannot find some header files. It has been a long time since I have done this sort of build. I remember that … | |
I am creating a check register for class. We are working on functions - pass by value and pass by reference. I have created all my functions and they seem to be working. However; there is a problem with my currentBal calcuation. When you have an inital transaction the transAmt … | |
hi can someone tell me a standard approach 2 solve number pyramids in cpp.some pyramids r easier but what i hav observed is dat every problem requires a different approach.when we r workin on a same environment den why not hav a std approach?? |
The End.