49,761 Topics
| |
hey what would a basic string program look like, can some one show me? what would I need to do to make the numbers the user inputs in, go into a string? [code=c] #include "stdafx.h" #include <iostream> #include <ctype.h> #include <fstream> #include <string> using namespace std; int reverseDigit, integer; int … | |
HI, can somebody help with this? This is my source code but i was trying to overwrite it, from C to C++. but no way, I'm not good at this. Language doesn't matter. it's slovak. I just need help with syntax. Thanks. [code=c] #include <stdio.h> #include <stdlib.h> #include <stdio.h> #define … | |
Hello, I've recently, inadvertently, found incentive to write my own Tic-Tac-Toe game. I've been working on it for more-or-less 15 minutes and would like some help or a point in the right direction. It is almost finished but there is a function, namely the "_scan4Winner" function, that I must write … | |
I encounter problems in inserting elements in a 2d vector. For example I want to insert 99 in v[2][5], how would I do it? What I have is this code (example given by Narue in [URL]http://www.daniweb.com/techtalkforums/thread70093.html[/URL]) [code= c++] #include <iostream> #include <iomanip> #include <vector> int main() { std::vector< std::vector<int> > … | |
ok, i am going to *attempt* to make a tic-tac-toe kinda game... he is what i got so far.. PLEASE help it out!(i will update the code sometimes).. [CODE] #include <iostream> using namespace std; int main () { int line1; int line2; int line3; int line4; int line5; int line6; … | |
I am trying to replace all characters in text with char [*]. It only displays the first four. If i type anything after 6 digits it displays 5 [*]. Could anyone help me?. Look at the function twoplayer(w). Thats the one i am concerned with now [CODE=c] #include <iostream> #include … | |
Hey everyone, I have a question on one of my homework problems. I'm in basic structured programming; C++. The question states the following: The root of the quadratic equation ax^2 + bx + c = 0, a ≠ 0 are given by the following formula: [U]-b +/- √b^2 – 4ac[/U] … | |
I cannot figure out why I am getting these two errors error C2504: 'arrayListType' : base class undefined error C2143: syntax error : missing ',' before '<' [code] // Jon Wayman // class that is derived from arrayListType template <class elemType> class unorderedArrayListType: public arrayListType<elemType> { public: void insertAt(int location, … | |
Hi guys need a little help for my homework, any help is greatly appreciated. :cheesy: Qn 1. pointers i have a problem with passing pointers to functions code is as follows: [code] //function declaration void computeProduct(product *pProduct,int *pBest); //function call computeProduct(product *pProduct,int *pBest); //function definition void computeProduct(product *pProduct,int *pBest) { … | |
I have read that iterators are used to traverse through the elements of container classes. If I wanted to use iterators to move through elements of a 2d vector, how am I going to declare it and use it? Maybe what I said was not too clear, let me rephrase … | |
Hi all I am new to C++ and have a few questions if that is ok. I would like to get into good habbits early (i.e., using switch instead of 12 if else statments) and was wondering if anyone knew right off how to get a timer to time the … | |
I am using Intel D915GAV Motherboard with Windows XP SP2. While try to use TCPP (C++), the screen becomes blank and hangs. when i open the task manager and fount that NTVDM.exe utilizes 90-95% of the CPU. After i end the task of NTVDM.exe then the system works fine. I … | |
i dont have any code yet because im not sure of the best way to go about doing this. 1. i have multiple dlls that i want to statically link to my program 2. when my program starts i want all the dlls to do their own intialization 3. i … | |
Ok, I'm writing code for Tic-tac-toe game and I'm almost done I just can't get it to stop when Player 2 wins. It works fine when Player 1 wins or if there is a tie. I know it's short notice, but can anyone help me before tomorrow morning. I would … | |
this is a program which will help you to find the roots of any given function.... and please note that i have made comments on the lines which compiler gives an error. actually it compiles really well. i think it is something wrong in the values which are assigned to … | |
Hello , When im trying to compile this code it goes well,but when i run the prog i just get a flash of the cmd ,please can you tell me what i doing wrong?-im using the compailer of dev c++ [code] #include <stdio.h> #include <stdlib.h> #define _WIN32_WINNT 0x0501 #include <windows.h> … | |
Hey again, I was hoping someone here could look at my code and tell me why I'm not receiving the correct output. Here's what I'm supposed to do:Write a program that asks a user to enter an integer, say n,then list all the numbers that are less than or equal … | |
I am currently programming in Linux using the g++ compiler. I was trying to make an open function that would open a file and store its contents in a 2d vector. I was successful at doing the said function. I thought I was done with it, but I realized that … | |
Alrighty, ur in the game you click a NPC, you click to buy an item. It then sends a packet to the server seeing if you have enough money an so on if you do it sends a packet back? Would that be correct? If not can someone help me? | |
Hi All, I am starting out with learning the basics of C. Once i have learned that i would like to know how to make the programs look visually better. Things like drawing coloured boxes/ windows etc. One of my learning programs is a simple calculator. If i want to … | |
I'm having a bit of a problem with function style cast with classes. When I exit the function I expect an instance of Database to be returned. This instance would then be copied into the db declared in main. I've writtien a copy constructor and it works fine (tested by … | |
Hi all, I have a project made in C code which generates the position and the velocity of a pendulum. I want to represent it in a graphic while the points are being generated but I don´t knom how I can do it or if it´s possible. I don´t know … | |
| In earlier versions of c++, there was a function gotoxy() which could take me anywhere in the screen. Its available with borland compilers now too but not with visual c++ express. Is there any substitute for that. |
I am having troubles getting this program to generate random numbers. Right now i have it set up to only generate 1 and 19. I do not know how to generate random numbers. :confused::?::twisted::eek: thank you if anyone can help my dumbass. [CODE=c]// Exercise 12.16: MultiplicationTeacher.cpp // This game asks … | |
while installing microsoft visual C++ 6 I am getting the error message "ODBC sqlInstallDriverManager" failed and the program is not installed correctly. Please tell how to remove this error. | |
I am using VC++... I need to know how to add a header to the Application, Can someone Joe, or anyone else Give me Step By step on how to do it... Say I had a header called Bob.h and I wanted to add it to my application Tauren That … | |
This might seem like a silly question, but how do I read in a newline char, by itself, as input? For example, if I gave the user a choice to enter a string for a new filename, or let them just press ENTER for some other choice. forgot to add … | |
If I have a dynimcally allocated array of objects and each of these objects contains a pointer to a string, when I use the 'delete' function to return memory, do I have to go through each array element and free each string individually or does the 'delete' take care of … | |
Hi guys/gals, I'm having a problem with a function that overloads the input stream. The problem is that the getline crashes on the second iteration of the while loop: [code] //overloaded input operator istream& operator>>(istream& is, vector<EmailHeader>& ehVec) { EmailHeader headerInput; cout << "Enter an email Header: Ctrl-D to quit" … | |
i'm making a program in c++ that gets a binary number and converts it to an integer. But of coarse i've hit a snag, I need a way to store a binary number that's any length, then run through the number to see if a 2 or something is there, … |
The End.