49,761 Topics

Member Avatar for
Member Avatar for bigben09

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 …

Member Avatar for Infarction
0
113
Member Avatar for bukaj

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 …

Member Avatar for bukaj
0
168
Member Avatar for Lazaro Claiborn

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 …

Member Avatar for Lazaro Claiborn
0
468
Member Avatar for tinie

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> > …

Member Avatar for tinie
1
5K
Member Avatar for lotsofsloths

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; …

Member Avatar for Lazaro Claiborn
0
319
Member Avatar for torbecire

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 …

Member Avatar for John A
0
100
Member Avatar for Duki

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] …

Member Avatar for Duki
0
2K
Member Avatar for SHWOO

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, …

Member Avatar for Narue
0
140
Member Avatar for ReDeViL

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) { …

Member Avatar for ~s.o.s~
0
225
Member Avatar for tinie

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 …

Member Avatar for Narue
0
4K
Member Avatar for Duki

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 …

Member Avatar for Narue
0
136
Member Avatar for mrparthi

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 …

0
41
Member Avatar for soveijn

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 …

Member Avatar for soveijn
0
74
Member Avatar for trunks1212

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 …

Member Avatar for John A
0
158
Member Avatar for nadith_cs

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 …

Member Avatar for iamthwee
0
109
Member Avatar for kobi

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> …

Member Avatar for Ancient Dragon
0
371
Member Avatar for Rickenbacker360

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 …

Member Avatar for psycotic_furby
0
118
Member Avatar for tinie

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 …

Member Avatar for Lazaro Claiborn
0
131
Member Avatar for Tauren

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?

Member Avatar for WolfPack
0
119
Member Avatar for andy257

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 …

Member Avatar for ~s.o.s~
0
140
Member Avatar for degamer106

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 …

Member Avatar for Ancient Dragon
0
179
Member Avatar for ziman

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 …

Member Avatar for Ancient Dragon
0
77
Member Avatar for GreenDay2001

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.

Member Avatar for GreenDay2001
0
480
Member Avatar for elcrapo

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 …

Member Avatar for WaltP
0
137
Member Avatar for md_salman

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.

0
45
Member Avatar for Tauren

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 …

Member Avatar for John A
0
127
Member Avatar for degamer106

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 …

Member Avatar for WaltP
0
4K
Member Avatar for degamer106

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 …

Member Avatar for Salem
0
128
Member Avatar for oolatin79

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" …

Member Avatar for Ancient Dragon
0
126
Member Avatar for Matt Tacular

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, …

Member Avatar for Matt Tacular
0
87

The End.