49,757 Topics

Member Avatar for
Member Avatar for Singularity83

Greetings programming community, How can I get this recursive function that finds the average of an array from any range using specific parameters to work? The parameters are (int a[], int x, int y). The x parameter means begin at and the y means end at. int k; //no global …

Member Avatar for Singularity83
0
197
Member Avatar for veronicak5678

Is there a function to remove spaces from a string? I need a way to have a user input a string with spaces, numbers, and letters and remove all spaces before storing it. Using scanf, cin, gets or fgets, apparently I only retain whatever is before the first space.

Member Avatar for bridgett.grace
0
2K
Member Avatar for cannon_1

I want to implement an algorithm in c++ using two concurrent infinite loop: the first infinite loop produces the upper bound on each iteration and the other infinite loop produces lower bound on each iteration. Both loops would terminate only when the the upper bound and lower bound meets. What's …

Member Avatar for cannon_1
0
268
Member Avatar for Vivek_12

#include <iostream> #include <string> /*i want to compare string and char as char is a subset of string*/ string S [50]; //algorithm is somewhat like: i=0; while(i<23){ char c = (char) i; S[i] = c; } for(i=23;i<50;i++){ S[i]="hello"; } //i want to check how many hello are there i=0; x=0; …

Member Avatar for Vivek_12
0
462
Member Avatar for iikitty

The following is a part of a hailstone cpp program. I want to write an option to let users enter 2 numbers and the program evaluates the longest sequence the number has within the 2-number range and return the count. I have been struggling it for hours :P but the …

Member Avatar for Moschops
0
255
Member Avatar for Tavershima

c++ program that will convert between function kilogram to convert pounds to kilogram, a function celsius to convert temprature in dgrees fahrenheit to degrees celsius, A function fahrenhiet to convert temperature in degrees celsius to degrees fahrengeit. [Click Here](null)

Member Avatar for David W
0
120
Member Avatar for Avdhesh_1

Question1. Your task is to complete the program provided by providing the three missing classes, Minus, Times and Divide. Next, you should extend the program so that it supports relational, logical and conditional expression operators as defined by the following extension to the grammar: <exp> -> '(' <operand> <op> <operand> …

Member Avatar for rubberman
-1
408
Member Avatar for Silfro

Anyone knowledge with reading binary file intro struct? I got weird error.. The first line is correct but then its only trash.. http://s14.directupload.net/images/141003/nz6k6cd2.jpg it starts 1,0,450 and then it should be 2,450,1200 3,1200,xxx and so on. Load file function: bool CNtlFileSerializer::LoadFile(char* pszFullPathFileName, bool bCrypt /* = FALSE */, char* szCryptPassword …

0
101
Member Avatar for vergil1983

HI and good day to all, Since my 2nd year of my uni life, i have hardly touch C++ programming especially OOP in C++.Now starts my revision on C++ OOP. Since I have forgotten many OOP knowledge there is a question I wish to ask. Below is my code. #include …

Member Avatar for vergil1983
0
181
Member Avatar for hurtmemore

I already tried to seek some tutorials in youtube but found nothing but b-tree only and no b*tree articles. Please guys I really need your help :(

Member Avatar for JasonHippy
0
119
Member Avatar for yeyo_1

can someone give me a detailed explaination why this won't compile, thanks` #include <iostream> using namespace std; int main () { int num1 = 5, num2 = 10; if (num1 < num2) { cout<<”num1 is less than num2”; else cout<<”num1 is not less than num2”; } return 0; }

Member Avatar for yeyo_1
0
183
Member Avatar for Nana_29

Solutions to quadratic equation Ax^2 +Bx+C=0 All solutions must be calculated in visual studio including the imaginary parts and using if statement

Member Avatar for NathanOliver
-1
179
Member Avatar for aluhnev

Hi all,have this code: Hi all,have this code: How do i implement binary search to display item.. found at index.. #include "stdafx.h" #include<fstream> #include<iostream> #include<string> #include<iomanip> using namespace std; struct sDetails{ int kNum; string Name; }; int _tmain(int argc, _TCHAR* argv[]) { sDetails students[5]; ifstream infile; infile.open("student.txt"); for (int i …

Member Avatar for tinstaafl
0
151
Member Avatar for bensila4

hi, my name is Ben,am new to c++ and i have this assignment to do.am stuck please somebody help me out Frequency of letter pairs Write a program to count the occurrences of all letter pairs in a sample of text (like the first paragraph of the Constitution). Disregard differences …

Member Avatar for tinstaafl
0
103
Member Avatar for Vincent_5

Im building a banking system. in my create_account it asks for account address and phone number as well as other questions. When I go to my Show account info (balance inquiry) I notice its not getting the right address as well as phone number. its showing "garbage". Im not sure …

Member Avatar for tinstaafl
0
379
Member Avatar for cannon_1

I have built Boost from the website using ./bootstrap.sh ./b2 install [IMG]http://i.stack.imgur.com/VDrHd.jpg[/IMG] [IMG]http://i.stack.imgur.com/ZaBfk.jpg[/IMG] I think all are installed properly. I am trying to use Xcode to include the library of boost:thread.My code links to the header file properly with " #include "boost/thread.hpp"" commented, as seen from the following: [IMG]http://i.stack.imgur.com/XW1qE.jpg[/IMG] However, …

Member Avatar for mike_2000_17
0
357
Member Avatar for BMutev

Hello guys, I've wrote a symbol table creator that uses hash function to determine the position of the symbol in the table and a linked list approach for the storing process in the table. And to the point. I've known myself for doing easy problems the hard way(and my teachers …

Member Avatar for NathanOliver
0
189
Member Avatar for Tycellent

So i've decided to use SFML and i'm just trying to figure out its advantages and disadvantages...I've looked around and this is what i've got so far. Advantages: * Cross Platform * OO Design * Simple and fast (subjective) Disadvantages: * Quite new Any additional thoughts will again appreciated

Member Avatar for Sarkurd
0
667
Member Avatar for Jinxx

I have written a code that asks the user a name (ex.candy) and a number then it stores it in a stuff.txt file like so: " candy 20 candy 40 decorations 70 costumes 40 candy 60 " When reading from that stuff.txt file, how can I add the running total …

Member Avatar for tinstaafl
0
806
Member Avatar for lewashby

I've been reading 'Learn C++ By making Games' and it uses the SDL library. The problem is the book has poor code examples, a lot of them don't even show the #include <libraries> instead jump straight to the main() function. So I just ordered the book 'Linux Graphics Programming with …

Member Avatar for lewashby
0
686
Member Avatar for nitin1

Today, I faced very weird problem. I have 2 classes say class A and B. Both have one .h and .cpp files. 4 files(A.cpp,B.cpp,A.h,B.h). A class is base class of B and we are using instance of B in class A. It was saying "not a type" error while compiling. …

Member Avatar for NathanOliver
0
312
Member Avatar for cambalinho

i'm very confused and the others forums make me more confused :( i'm using string, so i need convert string to WCHAR*: const size_t len = filename.length() + 1; wchar_t wcstring[len]; swprintf(wcstring, len, L"%s", filename.c_str()); Gdiplus::Image img2(wcstring); the img2 read the file normaly, but i'm creating another Image variable in …

Member Avatar for JasonHippy
0
428
Member Avatar for Cowboys1

: This is my program and its not compling empId numbers, can you tell me whats wrong?

Member Avatar for Lerner
0
94
Member Avatar for aluhnev

Hi,i used this example for practicing,supposed to be easy one,but,abit confusing. Can you help to solve and point to mistakes i've done. Postman Pat became bored one night at the postal sorting office and to break the monotony of the nightshift, he carried out the following experiment with a row …

Member Avatar for Lerner
0
719
Member Avatar for Moaid

hello i download qt sdk and started the qt creator and tried to do a simple empty project but it says The program has unexpectedly finished on the error list and i tried many examples but same thing happens , im using windows 7 x64 homepremium and mingw as a …

Member Avatar for mike_2000_17
0
246
Member Avatar for Tlotleng

Like the title says; Why would you want to make class objects (instances of a class) instead of built in types parameters of a function and in C . E.g. Why do this: class Person { public: void SetAge(Person &Age); instead of this: class Person { public: void SetAge(int iAge);. …

Member Avatar for Neuman
0
280
Member Avatar for DS9596

Rich Software Inc. has hired you for an internship position to create new payroll software for their 5 employees. Your goal is to create a program that reads the data.txt file with their 5 salaries. After that, the user can select from a 4 choice menu that handles the user’s …

Member Avatar for deceptikon
-2
161
Member Avatar for Shibbir Khan

I have this function and everything works until a and b both equal 1. When that happens the carry bit is going to 2 when its supposed to be only 0 or 1. Is my algorithm wrong for the carry bit carry_bits |= ((a & mask) & (b & mask)) …

Member Avatar for Moschops
0
204
Member Avatar for shahera.arafat

**this is the code and it keeps giving me a red line under (z=v2*v1),,please help me finding the mistake :( :( thanks ^_^ #pragma once using std::cout; using std::cin; using std::ostream; using std::istream; class vector{ public: friend ostream& operator<< (ostream&,vector&); friend istream& operator>> (istream&,vector&); friend vector operator*(vector &,vector &); vector(void); …

Member Avatar for shahera.arafat
0
203
Member Avatar for ndowens

I am trying to learn C++. I wrote a little calculator using class to see if I can do it and give some practice. The following is the code: [CODE]#include <iostream> using namespace std; class Calculator { float a, b; public: float add(float, float); float subtract(float, float); float multiply(float, float); …

Member Avatar for egidijus.aranauskas
0
4K

The End.