Posts
 
Reputation
Joined
Last Seen
Ranked #44
Strength to Increase Rep
+16
Strength to Decrease Rep
-4
96% Quality Score
Upvotes Received
174
Posts with Upvotes
160
Upvoting Members
69
Downvotes Received
5
Posts with Downvotes
5
Downvoting Members
5
138 Commented Posts
7 Endorsements
Ranked #260
Ranked #65
~671.50K People Reached
Favorite Tags
c++ x 2K
c x 394
Member Avatar for rodeostar04

I am having problems using the square root function in my program. I have included <cmath> outside of main and my formula using the square root looks like this: area=sqrt(s*(s-a)*(s-b)*(s-c)); but, I keep getting an error that says 'sqrt' cannot be used as a function. I would appreciate any suggestions. …

Member Avatar for N@sir
0
5K
Member Avatar for Nikhar

Hi everyone, This might be a very stupid question to ask and the answer might be very simple but I was just curious to know this. How to display "\n" on output screen in C++? We all know \n is used to enter a new line. But what if I …

Member Avatar for rubberman
0
2K
Member Avatar for Esmerelda

One of the questions given to us for the lab exam was to generate the first 10 armstrong numbers. I could generate upto 5 numbers correctly..the rest are wrong. [code] #include<stdio.h> #include<conio.h> void main() { int n=1,a,b,i=1,r; clrscr(); while(i<=10) { a=0; b=n; do { r=b%10; a=a+r*r*r; b=b/10; }while(b>0); if(a==n) { …

Member Avatar for Tushar_4
0
2K
Member Avatar for payara111

How can i print it recursively with one helper function? [img]http://img2.imageshack.us/img2/1690/recursive.th.jpg[/img] Here, n will always be a power of 2 and c will be indicating the column number from which to start the output. The above pattern has been produced with the initial function call RecursivePattern(8,1) It prototype should be …

Member Avatar for Chetana_1
-1
2K
Member Avatar for Duki

Hey Everyone, I'm doing a little test for a presentation I'm giving on Tuesday. I wanted to show the performance difference between VB2008, C# and C++. To do this, I have three programs. Each program performs the Fibonacci sequence X times, and can either do it iteratively or recursively. As …

Member Avatar for Loïc
0
930
Member Avatar for homeryansta

[CODE=C++] #ifndef LIST_H #define LIST_H #include <iostream> typedef char Item; class List{ public: List() {first = NULL; last = NULL;} //~List() void append(Item entry); void remove_last(); void output(); private: struct Node { Item data; Node *next; Node *back; }; Node *first; Node *last; }; #endif [/CODE] I'm writing a class …

Member Avatar for Syed Zuman
0
967
Member Avatar for justinlake888

hello... I am trying to convert 2 digit numbers to words: example 11= eleven. I saw some other entries on this but they dont include case or switch so far I have: [code=cplusplus] #include <iostream> using namespace std; cout<<"Enter a two-digit number: "; cin>>number; if(number>99) { cout<<"Number out of range"; …

Member Avatar for hermel
0
2K
Member Avatar for GuitarComet

Hi! I'm working on a hobby OS. Almost every time I try to link my files I get a 'undefined reference to' error. As I've been trying to compile with different compilers, the errors generated by the linker changes. I have only been using different ports of the GNU compilers. …

Member Avatar for Ömer
0
315
Member Avatar for cassie_sanford

I have to write a program that must compute and display the charges for a patients hospital stay. first the program should ask if the patient was admitted as an in patient or an out patient. If the patient was as an in-patient the following data should be entered: the …

Member Avatar for rafiq_1
0
824
Member Avatar for cam875

can you call a function inside that same function so that it goes to the beginning of that code to execute it. So even though ur already in the prompt function can u still call it again from withing the code inside the prompt function. Thanks in advance.

Member Avatar for akshaykeerthi.srikanth
0
282
Member Avatar for MadnessCow

Hi guys. I'm pretty new to C program. I've been given this assignment to write a program that asks the user thow many terms of the serires equation to use in approximating PI. The formula given is pi=4X(1- 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + 1/13 - …

Member Avatar for Adak
0
6K
Member Avatar for kishore84

Hello friends did anybody have implemented the ant based clustering algorithm in C.If so can u pls pass me on the coding.It would of great help to me.

Member Avatar for Adak
0
353
Member Avatar for bramprakash1989

i tried the following coding .it compiled without errors but gave absurd results during runtime. can u pls help me with it? [code=cplusplus] #include<iostream.h> #include<stdlib.h> int main() { int i; cout<<"ten random numbers for the range 0 to 50"<<endl; for(i=0;i<10;i++) { cout<<rand()<<endl; return 0; } }[/code]

Member Avatar for dramatic
0
1K
Member Avatar for rrreeefff

Hello, I am trying to compute the GCD non-recursively. I have no errors but when I run the program it aborts because it says c is not intlized. [code=cplusplus] #include "stdafx.h" #include "stdio.h" int main (void) { int a,b,c,r,result; printf("enter a value for a\n"); scanf ("%d", &a); printf("enter a value …

Member Avatar for deceptikon
0
305
Member Avatar for QuantNeeds

I am not sure why this is occuring. I declared these functions in the header file and it is defined them in the .cpp file but in the main function it does not recognize them. Did I forget something basic or do something illegal? The errors: : error C3861: 'createAndInitializeTextFile': …

Member Avatar for fiqa92
0
4K
Member Avatar for gtsreddy

hi can any one help me which is the best C++ compiler one can download it freely for C++ programming i will appreciate if some one post any web links for this cheers reddy

Member Avatar for vijayan121
0
708
Member Avatar for asadullah

Assumption: 32-bit Machine. Here I am going to explain How Virtual table, Virtual pointer for Virtual functions are internally working. First we have understand memory layout. Example 1: How the class's memory layout Code: cpp [code=cpp] class Test { public: int data1; int data2; int fun1(); }; int main() { …

Member Avatar for kresimir
0
3K
Member Avatar for plike922

i am try to create a program that prints the numerical value of EOF... any ideas for the function get the value of EOF using the ASCII table????

Member Avatar for I_m_rude
0
512
Member Avatar for nishant3316

hi, I recently wrote this code to calculate the hamming distance between any two binary numbers... The program accepts the numbers in decimals, performs a bitwise XOR operation and returns the HD... However, it returns the Hamming distance in decimal... that is if after XOR it gets something like 0010... …

Member Avatar for SHIVANGII
0
607
Member Avatar for nizbit

I wrote a function that will search a string with a substring. When the substring is found, it is replaced with another substring. The problem I have with my code is that it wont replace the substring unless it is in the beginning of the string. Here's the code and …

Member Avatar for WytCZ
0
1K
Member Avatar for onemanclapping

hello. I'm doing a program in c++ and I need to use a system call to "clear" my screen. for linux I use system("clear") but in windows the same is system("clr"). is there some way to find which OS is being used at the moment of execution so the program …

Member Avatar for Ancient Dragon
0
2K
Member Avatar for fsemilla

good day to all... does anyone here have a basic tutorial on how to program using C for zigbee...? its just that i have a very important project task in my work which should be accomplished for three months:'( ...i do have basic...i mean enough knowledge programming in C but …

Member Avatar for agieli
1
2K
Member Avatar for twek

title is self explanatory how do i convert it to a std::string? all this LP stuff makes my brain hurt...

Member Avatar for easysir
0
3K
Member Avatar for tformed

I have created a program without using sqrt and the pwr function but instead have used logs and exponent. The professor said that math.h is not allowed. I am aware that this library is important for computation, but how do I compute the math without using the math.h? Would I …

Member Avatar for mikrosfoititis
0
1K
Member Avatar for mail2shrid

If i'm scanning from keyboard using getch(), how do i check which arrow key has the user pressed??(Arrow keys have ASCII values same as some other keys so we can't directly check for ASCII values)

Member Avatar for ashok1514
0
4K
Member Avatar for Phaelax

Can't seem to figure this out. [CODE] string *array; void addNodes(string names[]) { array = names; //how many elements in the array??? } [/CODE]

Member Avatar for Diego.Corso
0
27K
Member Avatar for CoolAtt

hi . can someone plz explain how to do regex in C. input: a text file. aim: read each line from the text & check if a RegEx pattern exists. finally return that pattern if it exists. plz share any algo or code snippets if u have.thx.

Member Avatar for rubberman
0
230
Member Avatar for mrrko

[I]Negotiating a consumer loan is not always straightforward. One form of loan is the discount installment loan, which works as follows. Suppose a loan has a face value of $1,000, the interest rate is 15%, and the duration is 18 months. The interest is computed by multiplying the face value …

Member Avatar for Bummpy 1
0
1K
Member Avatar for dooper

here is my code: [code]#include <fstream> #include <iostream> #include <string> #include <fstream> #include <string> using namespace std; void displayjulianDates(int, int, int, int, int, int); int main() { //Declare variables int month1; int day1; int year1; int month2; int day2; int year2; //Gets input from user cout << "Please enter the …

Member Avatar for Masterlynx
0
305
Member Avatar for jaepi

hi there, i just want to know what function to use in converting a char into an int like: [code] char temp; cout << "enter something"; cin >> temp; atoi(temp); [/code] is this the right way?

Member Avatar for WaltP
0
1K