51,593 Topics

Member Avatar for
Member Avatar for koolman123

Well, please excuse my noobiness, and my little skill with C++, but give me a break, I'm young. Not for homework, just for the sake of being able to do it,I was trying to make a code for the Pythagorean theorem, and here is the start of the code (of …

Member Avatar for Fbody
0
223
Member Avatar for Zviri

Hi, I have a following problem. I have a number in string, for example "123456" and I'd like to convert it to int. This would not be a problem if I knew that the input number will always fit into an 32 bit integer. So if it won't I should …

Member Avatar for Nick Evan
0
345
Member Avatar for phfilly

Hey just wondering if someone could help me please with the following: board.h [CODE]public: Piece* Player1Pieces; Piece* Player2Pieces;[/CODE] (a section showing the initialization of the arrays) board.C: [CODE]Player1Pieces = new Piece[18]; Player2Pieces = new Piece[18]; char arrX[9] = {'a','b','c','d','e','f','g','h','i'}; for (int FootCount = 0; FootCount < 9; ++FootCount) { --->> …

Member Avatar for Fbody
0
276
Member Avatar for meazza

hello fellow programmers. I am having an anoying problem with a Contact book i am making. As the title of this thread suggests i am getting that error but only when i call for a specific function in the program called void search(). All the other functions in the class …

Member Avatar for meazza
0
292
Member Avatar for frogboy77

Hi, new to this so go easy. I'm trying to store a function i wrote in a file and call it with a header file rather than copy and paste as ive been doing but i keep getting error messages from the compiler. Can anyone point out what i'm doing …

Member Avatar for frogboy77
0
140
Member Avatar for Jsplinter

If I'm creating a new char[] to read in a text file: [code]char* pbuffer; pbuffer = new char[length]; [/code] what is the maximum size length can be? Would a std::string be better? pbuffer will only be allocated one time in scope no matter what, and length is not known until …

Member Avatar for Jsplinter
0
157
Member Avatar for jmcorpse

Hello, I have this probelm posted below. I pretty much have it figured out and it is still in rough draft form. I know it could be optimized better but, I'm not quite sure how to get it to look better. Although, the main reason I am looking for help …

Member Avatar for Fbody
0
105
Member Avatar for The Hisel

I have a machine that waits for short/long periods of time, and some data that I am writing to the server is being ignored during the transfer. If the machine waits for more than 10 minutes, roughly, I noticed 2 global variables aren't getting reported. The delimiters before and after …

Member Avatar for The Hisel
0
101
Member Avatar for sundip

Hi All Can anyone tell me about some good tool to auto indent the code c++/objective-c/c with some customization features.

Member Avatar for sundip
0
71
Member Avatar for rebellion346

Hey guys, so my assignment is making a program that takes 2 measure objects and multiplies them together and displays them in square feet. What I'm trying to do is convert the feet into inches for both of the measure objects, then multiply the added inches together. Then I'm trying …

Member Avatar for Nick Evan
0
147
Member Avatar for mr-smith

Interstate Motorway Pty Limited requires you to design a program that will produce, among others, customer statements for passing through E-way checkpoints of four toll stations (denoted by A, B, C and D respectively) distributed on the nationwide motorway. The charge of each pass is specified as follows Station A …

Member Avatar for Nick Evan
-2
193
Member Avatar for watery87

Hi guys, i just written a simple program which requires some date verification. However im facing some trouble with the input Problem 1: if the input has more than 8 chars, garbage characters gets printed Problem 2: if input contains invalid values(like negative), error gets printed Problem 3: if input …

Member Avatar for watery87
0
122
Member Avatar for tiger86

I am making a game where I need to take one image and make it into multiple images. then when I click on the image, I want one to dissapear at a time. I believe this can be accomplished via arrays. I am still pretty new to C++, so I …

Member Avatar for tiger86
0
199
Member Avatar for linux

Does anyone here know of a good C++ compiler for Ubuntu Linux 6.06LTS? Preferably available by means of apt-get or wine. Dev-C++? I couldn't find it for Linux... -- Alex; any help appreciated

Member Avatar for Stefano Mtangoo
0
193
Member Avatar for atramposch

supposed to declare a string of a certain size (eg. char str[81]) Then input a string from the keyboard (spaces included) using the while (NOT, gets(), or fgets()) technique (while ((str[i] = getchar()) != '\n')) adjusted so that it only inputs a certain number of characters (in the above example …

Member Avatar for Ancient Dragon
0
152
Member Avatar for rebellion346

Im getting an error that says unresolved external and i have no idea what to do, does anybody have any ideas? by the way im not sure if my code actually does what its suppose to do, its still in the works [CODE] #include <iostream> using namespace std; class Measure …

Member Avatar for rebellion346
0
88
Member Avatar for kazuki05

hey guys! mind if you help me here? we were asked to make a grading system. here is my code.. [CODE] #include <iostream> #include <string> #include <cstdlib> #include <iomanip> using namespace std; void main() { system("CLS"); char fn[50],ln[50]; string *name, *enam, temp, *R, wN, fin, lan; double gr, *g, temp2, …

Member Avatar for Anyzen
0
110
Member Avatar for haroldelam

[CODE]#include <iostream> #include <string> #include <iomanip> using namespace std; // //CLASS DECLARATION SECTION // class EmployeeClass { public: void ImplementCalculations(string EmployeeName, double hours, double wage); void DisplayEmployInformation(void); void Addsomethingup (EmployeeClass, EmployeeClass, EmployeeClass); string EmployeeName ; int hours ; float wage ; float basepay ; int overtime_hours ; float overtime_pay ; …

Member Avatar for haroldelam
0
117
Member Avatar for Jake1905

I am trying to figure out how to set a float for a project I am doing. Example I am trying to set a float for a score but I would like the input to be set where you can't input a number over a 100. This is the code …

Member Avatar for VernonDozier
0
126
Member Avatar for gujuplayer

I am not understanding how to convert a 2d array from c to Mips assembly. Like if you had int array[5][2]={{1,1},{2,2},{3,3},{4,4},{5,5}} how would you convert that to Mips assembly and access it like x=array[i][0] & y=array[i][0]?

0
90
Member Avatar for twitchybear

Everything works fine except when you roll a non-instant win or lose, you always win on your next roll #include <iostream> #include "Crapsfunctions.h" #include <conio.h> #include <ctype.h> using namespace std; void main() { double Money; double Bet; long Roll; long Roll2; long Point; long NumRolls; char Answer; //prototypes long throwdie(); …

Member Avatar for WaltP
0
164
Member Avatar for Suzie999

Can anyone tell me where to get started to get an md5 or sha1 checksum of a given file. I've searced around and all I can find are utilities, I also looked at wincrypt but It seems to me that it just does passwords and strings and suchlike. Any help …

Member Avatar for Suzie999
0
668
Member Avatar for taylord69

i have to write a function (dayNumber) that returns the day number in a year for a date that is provided as input data. i cant use const, struct, or loops, it has to be very basic stuff. i have something written but i can figure out how to get …

Member Avatar for taylord69
0
116
Member Avatar for techie1991

I was trying to code the assembly line sheduling problem using the dynamic programming approach. I have coded the program but i am facing problem with the 2-dimensional arrays I am using. For testing purpose, I wanted to initialize the array, but I was not able to get it. Moreover, …

Member Avatar for Fbody
0
216
Member Avatar for LoLFactor

I'm interested in making an .ini file parser and I want it to have an internal list that can hold it's individual entries. The catch is I want to make one list to hold all the values. That means strings, boolean values and int types. I have a class to …

Member Avatar for Momerath
0
218
Member Avatar for Ninoaoe

hi!!!! i'd like to ask if anyone knows how could i possibly use a string as a number...i mean: i've got something like cin>>word; but if that word is a number(like 1,2,3... etc) i have to use that number for going in that line. if user types ''hello'' its ok.but …

Member Avatar for Ninoaoe
0
132
Member Avatar for bnath001

Howdy, I want to make a sql that goes to oracle. the sql should be "Select "cusip", "price structure" from tableA" (basically the columns are wrapped in double quotes. I used this synatax in C#: string mysql = "select "+'"'+"cusip,"+'"' + '"'+ "Price structure\"" from tableA" and I am getting …

Member Avatar for Kimpl
0
116
Member Avatar for Diogo Martinho

I am facing a very simple problem that many of you will be able to solve, however I'm having a hard time trying to figure a method to program this. I am trying to create a dynamic array with the many prices of different clothing for a shop I'm creating. …

Member Avatar for Fbody
0
165
Member Avatar for heidik

Could anyone please show me a working example of how to find if a file exists but is empty or not? Thanks

Member Avatar for Ancient Dragon
0
354
Member Avatar for chiyuwang

In my programe I need to replace _open and _wopen by windows api function, I think the function OpenFile should be the one. Are their return values are same indeed, since _open/_wopen return int, while OpenFile return HFILE, and those enum type look confusing. Can anyone help with it? At …

Member Avatar for Ancient Dragon
0
86
Member Avatar for hag++

Hi All, I am writing an MFC Tic Tac Toe app and I am getting a strange error when debugging it. This module loads a bunch of BOOL variables to keep track of whether or not the tile next to it matches (i.e is the tile next to me also …

Member Avatar for hag++
0
362
Member Avatar for Chalson

After i key in 20 different value of float, what command should i use so that i can determine the largest and smallest value from these numbers ?

Member Avatar for PsychoLogic
0
201
Member Avatar for punchinello

Hi I'm new to MFC programming. What do I do if I want to make my window look better? Say, with a button that is not rectangular but oval? And maybe throw in some animation effects? Thank you very much!

Member Avatar for punchinello
0
81
Member Avatar for morgon

I have made a wery simple program but i still get a linker error I have one class Node.h #[CODE]ifndef Node_H #define Node_H #include <iostream> using namespace std; //class node has four fields: type, child1, child2 and parent. The type is -1 if it is a inner node, 0 if …

Member Avatar for gerard4143
0
113
Member Avatar for ImaginaryHero

I am at the beginnig of the softphone project for my university final project.. I will implement a softphone with using SIP protocol and C++ language on linux. I need some advice about tutorials, usefull API and whatever which will help me. Thanks..

Member Avatar for alwaysLearning0
0
3K
Member Avatar for Suzie999

Hi. Hoping someone could direct me to a starting point for project. No code, I havent started yet. Im looking for a start on finding the proccess exe name that calls a function in my dll file. Just looking for a place to start looking.

Member Avatar for Suzie999
0
170
Member Avatar for Scoppio

Hi, i'm doing a small program that communicates with my first SQL Server, but I'm having some troubles with the C++ (I'm usued to C only, and use it for developing microcontrolers firmwares). What Im trying to do here is it: Write the USER and PASSWORD in a form, then …

Member Avatar for Scoppio
0
207
Member Avatar for Hey11

hello i wanted to ask how to create a function that makes the insertion code search for an occurence that i will insert with a cin , instead of picking the first occurence for example the array is arr[]={1,2,3,5,3,1,3} there are 3 threes here , i want to get the …

Member Avatar for myk45
0
108
Member Avatar for tKc

I am required to make a code that makes a pyramid with number of input lines "n" to a text file. What i figured i would do i make the program so that it makes a pyramid on the screen and then write it to a text file. This is …

Member Avatar for Agni
0
168
Member Avatar for pharoah85

Im new to c++, Ive been plowing through books,web,etc. Many of the things im learning seems redundant but being new as I am I figure that it stems from lack of knowledge. Now finally my questions...Whats the significance of using pointers to reference variables when i could just flat out …

Member Avatar for pharoah85
0
186
Member Avatar for arun_l

We are getting these constraint errors wherver OSAF calls like m_NCS_SEL_OBJ_ZERO(&nSelObjSet) is called in our code. This is while cross compiling using tilera compiler - tile-g++. With g++ it always compiles fine. Any pointers would be helpful. Sample Code: 102 // initialise and set selection object set 103 m_NCS_SEL_OBJ_ZERO(&nSelObjSet); 104 …

Member Avatar for arun_l
0
156
Member Avatar for sahil1991

hi to all, i was looking for some objective type questions on c++ on the internet............ i got few but some with wrong answers and some with no answers at all....... i would love to hav some e-book on it or a larger question bank with answers........suggest me some links …

Member Avatar for Ancient Dragon
0
173
Member Avatar for nickx522

I need help on "for" statement .Im doing exponents. I did a while statement already in which i checked if base is in range. help please. [CODE] for(int count = 0; count <=Expo; count++) Total1 = (dont know what this should be?) cout << setw(45) << "Total : " << …

Member Avatar for WaltP
0
203
Member Avatar for allizzee

I don't know how to make the computer play against me. Before I write more, anybody online right now to help. thx

Member Avatar for WaltP
0
116
Member Avatar for Nathaniel10

OK. I thought I understood pointers and such but this exercise is revealing that I do not. The task is to read characters into an array created on free store memory (heap), then print them out using the reference and dereference operators. My code (below) compiles and runs but does …

Member Avatar for Nathaniel10
0
126
Member Avatar for GregPeters

Hi all. I have recently been learning C++ and have gained a moderate understanding of how things work. Texts files seem to confuse me though so i was wondering if someone could help me out. :) Basically I have a text file which looks something like: [CODE]** <Question> What is …

Member Avatar for csurfer
0
242
Member Avatar for slychronic

Gooday i have a question to make a program using the connect function and all i hve done is below. how do i complete the the first loop and the second loop...on what i should do next here is my code so far, explaination will be appreciated....[CODE] #include <iostream> using …

Member Avatar for mike_2000_17
0
163
Member Avatar for jalenamichelle

what is wrong with this? i keep getting an error that says error C2059: syntax error : 'if' && error C2059: syntax error : 'else' [code] int main (void); void menu(void); int getChoice(void); int *year, *day, *month, julianday; int dayspermonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, …

Member Avatar for WaltP
0
98
Member Avatar for dwhite459

I am trying to write a program that allows the user to input positive integers between 0 and 1000 and then outputs the highest value and the lowest value. The user should enter -1 to signify the end of their input. I am supposed to use a loop to achieve …

Member Avatar for WaltP
0
6K
Member Avatar for sharifyboy7

For my program I am supposed to implement an encryption and decryption algorithm. I then have to print it out using my functions I have to read the input from a file, “plaintext.txt” The file will contain plaintext strings that are all lowercase, and be of the format: 3 hello …

Member Avatar for hag++
0
264

The End.