49,761 Topics
| |
hey..would anyone help me with my code. the program is supposed to get telephone starting and ending times from a file from the user then outputs the total duration and calculates the cost. my program does all this but it is giving me a problem in finding the total cost … | |
Hey everyone, I'm still tweaking the attributes but here is what I've got: [B]All races:[/B] dmg = rand, where 0 < r < str [B]Human[/B] 25% chance of blocking 5% chance of double attack (attack x2) 10% chance of dmg+60 [B]Elf[/B] 5% chance of blocking 35% chance of double attack … | |
Hi all, I want to use a dynamic buffer in one of my application. I'll explain it in this way. Depend on one of my calculation I found a number(int value), and I want to define a buffer size to that value. Then after doing all the required process need … | |
I have an exercise like this: Design a simple text editor in console mode, not window form max character in a line is 80 user can move cursor up, down, to left and right, insert, delete character I don't know how to build it :( i should use linked list … | |
Can anyone help me in developing a code to draw triangles with given the lengths of the three sides. | |
Hi all, I want to find the end of file in a CFile. What I've do up to now is, find the length of the file in bytes. Then do the required process with the number of bytes. Here is the code, [CODE=C++] int length = 0 ; CString str … | |
I have trouble approaching my program assignments. First I write out an algorithm. and work out each part if the program. Then I get nervous. and overwhelmed. with the errors in compliling and such. I have been working on the current assignment several days. And am frustrated and 2nd guessing … | |
I am just preparing to take a quiz and he said some examples will be kind of like this and I was just tryin to get some input on if these answers I have are the right ones.. he said just do what the statement says, no further work, just … | |
I don't know if this is the place to ask:confused: , but anyhow: My problem is this: I need to find the absolute minimum and maximum of a function of two variables, in a given bounded area. There are several numerical methods for finding local extrimum of functions, but none … | |
I searched the forums but I didn't find any useful information. I am just trying to write a simple recursive solution to do F(n). It seems simple to me but I am probably not thinking about it correctly. My program has no errors, but it only returns 55 and then … | |
Hi, if we had the following program:: [CODE=c++]int main() { int a, d; int b=12; int c=13; a=b+c; d=b+c; return 0; }[/CODE] what would gcc produce as a result? would it be:: [CODE]fetch b fetch c add store to a fetch b fetch c add store to b[/CODE] Or something … | |
Good day fellow Buds. I was working on a nother C++ program and suddenly the program did not want to compile. It gave me this error message: Compiler: Default compiler Building Makefile: "C:\Documents and Settings\Jan&Gretel\My Documents\Makefile.win" Executing make... make.exe -f "C:\Documents and Settings\Jan&Gretel\My Documents\Makefile.win" all g++.exe -c main.cpp -o main.o … | |
hi can any one help with Mersenne Prime numbers calculator. A prime number is defined as being a Mersenne Prime if it is of the form 2^n – 1, where n is any integer greater than 1 display all the Mersenne primes from 2 through 1,000,000. Your results should be … | |
#include <iostream> using namespace std; void getMonthName(int monthNum); void main() { int month, i=0; cout << "Enter a month " << endl; cin >> month; while (!cin.good() && i <3) { cout << " Bad input.\n"; cin.clear(); cin.ignore(80,'\n'); cout << " Try again: "; cin >> month; i++; } while … | |
Hello everyone I'm having trouble writing part of a vector to a file. I'm getting this error: [QUOTE]main.cpp:287: error: cannot convert `std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to `const char*' for argument `2' to `int fprintf(FILE*, const char*, ...)'[/QUOTE] This is part of my code: [CODE]ListViewTextItem.begin(); FILE * pFile; pFile = fopen … | |
| [CODE]void hexad(int i) { int j=0; int x=0; int chii=0; while(x<8) { second2[x]=' '; second1[x]=' '; x++; } switch(codesum) { case 744 : while(i<12 && temp[i]!='\0') { second2[j]=temp[i]; i++; j++; } strcpy(second1,"CE "); break; case 410 : while(i<12 && temp[i]!='\0') { second2[j]=temp[i]; i++; j++; } chii=second2[0]; switch(chii) { 'A' : … |
Hey guys, I am trying to take chars from a file, and place them into 2 different dynamically allocated arrays. An example of the file would be name:John Doe&id:1448&phone:98765 One array stores name, id, and phone, and another should store each value. I have gone ahead and taken the string … | |
Is it safe to compare strings with == operator or is .compare recommended? One of my teachers said NOT to use the == operator and always use a function when available. The example given was somthing along the lines of "when cpu is under high usage the == operator behaviour … | |
Why does the code below stop executing after displaying all the numbers stored in an array? [CODE]//this will let the user enter 10 values and //store them into an array. After that //sort it out and cout the largest and the smallest number entered #include <iostream> using namespace std; int … | |
Am not able to display the polynomial. Thr some problem in display function. Please help me out in this. [code=cpp] #include "stdafx.h" #include <iostream> using namespace std; // Creating a NODE Structure struct node { int coe,exp; // data struct node *next; // link to next node and previous node … | |
I think I've been up too long at this stage.. I think this is a really stupid question: How do I declare all my objects from main() ? I have an object 'sun' of the class 'CPlanet' and within that class there is an instance of the class 'CAnimation'. But … | |
Hello! I'm new to the the forum and to programming in general, so after learning how to make variables, if statements and loops (badly) I decided I was tired of so much learning and had to make some sort of program or game :) . Tic-Tac-Toe jumped to mind and … | |
I am sorry for that I have solved it, just missing a ";" when I define the class. I have re-edited this thread. So sorry for flippancy! | |
Hi, I have built a program for Dijkstra's algorithm, but not sure why it does not display the shortest path thru the matrix. Would someone please point me in the right direction to get the code to work. Thanks, code follows, no errors, but no display of path vertices for … | |
Hey, I'm brand new to this site. Hopefully someone can help me out. How do you clear the console screen without any system-compatibility issues? This means that SYSTEM("CLS") and anything from a windows library (like #include<windows.h>) is not acceptable, as it will not run on linux/unix etc... I know theres … | |
I have like 5 classes, 3 of then need around 15 constants the other 2 classes need only 2 of the 15. I was thinking of having a header file to contain all the constants in header file and just include them in the header files of all 5 classes. … | |
Hi there, Im trying to start learning C++, but I haven't been able to find any compilers for it. Does anyone know any good compilers for C++? Thanks. | |
I tried following this code for my program, but counting the consonants and vowels are not doing what I want them to. Is this the correct format to use? [code] #include <iostream> #include <string> #include <algorithm> using namespace std; void StateInstructions(); void GetInput(); void TurnUpper(); void TurnLower(); int NumVow(); int … | |
Hello, I am having some trouble on a light program. Ive spent the last 5 hours on it, and I'm a beginner so I'm relatively slow. =) I will show you what I have, but first I'll explain to you what I'm doing. I am writing a numerology program. I … |
The End.