49,757 Topics

Member Avatar for
Member Avatar for nicz888
Member Avatar for rajgopal.uoh

Can anyone help me in developing a code to draw triangles with given the lengths of the three sides.

Member Avatar for WaltP
0
38
Member Avatar for eranga262154

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 …

Member Avatar for eranga262154
0
551
Member Avatar for clski1973

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 …

Member Avatar for Duoas
0
303
Member Avatar for coolbreeze

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 …

Member Avatar for WaltP
0
88
Member Avatar for chanah

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 …

Member Avatar for Salem
0
86
Member Avatar for jacknight

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 …

Member Avatar for jacknight
0
82
Member Avatar for n.aggel

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 …

Member Avatar for n.aggel
0
159
Member Avatar for Jobe007

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 …

Member Avatar for Salem
0
51
Member Avatar for gehad3003

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 …

Member Avatar for gehad3003
0
792
Member Avatar for nicz888

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

Member Avatar for vijayan121
0
93
Member Avatar for curt22

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 …

Member Avatar for Salem
0
89
Member Avatar for handsome_94

[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' : …

Member Avatar for handsome_94
0
108
Member Avatar for pacman326@gmail

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 …

Member Avatar for pacman326@gmail
0
230
Member Avatar for rugae

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 …

Member Avatar for vijayan121
0
202
Member Avatar for rogenie

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 …

Member Avatar for rogenie
0
119
Member Avatar for sandhyamanheri

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 …

Member Avatar for Duoas
0
125
Member Avatar for phalaris_trip

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 …

Member Avatar for phalaris_trip
0
117
Member Avatar for Massena

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 …

Member Avatar for Massena
0
78
Member Avatar for meiyantao

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!

Member Avatar for meiyantao
0
210
Member Avatar for kpillsb39

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 …

0
87
Member Avatar for skatamatic

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 …

Member Avatar for WaltP
0
2K
Member Avatar for rugae

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

Member Avatar for vijayan121
0
126
Member Avatar for Azurea

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.

Member Avatar for ithelp
0
115
Member Avatar for dabu

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 …

Member Avatar for zandiago
0
153
Member Avatar for Flakester

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 …

Member Avatar for WaltP
0
119
Member Avatar for Arbhin

Hello, people. First of all, I am new to this forum, so greetings. Second, I just started with learning C++. All the help, on where to start lessons and the like, are ver welcome. Why did I start on programming. * I wanted to create a MMORPG. And thought about …

Member Avatar for Arbhin
0
128
Member Avatar for tracethepath

i have made a menu driven program for selection sort, bubble sort and insertion sort.. the first two are working correctly but despite writing the correct code (according to me, i have checked my code many times) the insertion sort is not giving the desired output.. here's my piece of …

Member Avatar for tracethepath
0
85
Member Avatar for cyndi.

Can anyone give me some help coz i need to make a program that accepts inputted decimal number and converts it to Binary, Hexadecimal, Octal. I should use looping statement, it should be function oriented, and uses switch case. This will be the sample output: ==================================================== Input decimal number : …

Member Avatar for WaltP
0
125
Member Avatar for nicz888

if i have 71, i need to display it like 17. backward if i have 113 i need to display it like 311. first number and last number are swiched i know i need to used a swap function but how do i used it? how do i extract each …

Member Avatar for WaltP
0
311

The End.