49,757 Topics

Member Avatar for
Member Avatar for akde

I have created a new C++ project (to be able to use the graphics.h library) then I have tried to add a C project which works perfectly in C (by the way I have saved the file with .c extension). 2 line leads to error: [CODE] q = malloc(sizeof(struct QueueRecord)); …

Member Avatar for akde
0
259
Member Avatar for stereomatching

How could we measured the relationship between types and binary files generated by compilers? [code] template<typename T> T Max(T const A, T const B) { return A > B ? A : B; } void testMax() { int a = 5, b = 10; double c = 44.4, d = …

0
46
Member Avatar for learner guy

hi i am a newbie at c++.. this is code of game am wondering why the text is blinking ? [CODE]/ /* Include section */ #define WIN32_LEAN_AND_MEAN #include <iostream> #include <windows.h> #include <cstdlib> #include <time.h> /* Using Statements*/ using std::cout; using std::endl; /* Constants */ #define X 20 #define Y …

Member Avatar for MandrewP
0
339
Member Avatar for james6754

[CODE] USHORT * pInt = new USHORT; *pInt = 10; std::cout << "*pInt: " << *pInt << endl; long * pLong = new long; *pLong = 90000; std::cout << "*pLong: " << *pLong << endl; *pInt = 20; std::cout << "*pInt: " << *pInt << endl; delete pInt; *pInt = …

Member Avatar for Moschops
0
120
Member Avatar for zo0oda

[COLOR="Red"]hello.... I'm new member and I'm so happy that i found daniweb.com to get some help from you my friends.... i need help in solving this problem...[/COLOR] •Select one program of your choice that implements Single or Double Linked List in C++. Make sure you use class in your program, …

Member Avatar for Narue
0
113
Member Avatar for mebrahtom

I tried to run this program and it runs.But when I go and open the file account.txt it says character encoding problem.it is created but doesn't open.help please! thank you in advance. [CODE][/CODE]

Member Avatar for Ancient Dragon
0
65
Member Avatar for stereomatching

compiler : visual c++ 2010 os : win7 64bits [CODE] std::string temp = "temp"; boost::tuple<std::string> A( std::move(temp) ); //this is copy std::tuple<std::string> A( std::move(temp) ); //better, woundn't compile [/CODE] this is inconvenient when I want to do something like this [code] std::tuple<std::string> kkk() { std::string temp = "temp"; return std::make_tuple( …

Member Avatar for stereomatching
0
313
Member Avatar for askerknight

[CODE]#include<iostream> using namespace std; int main() { int x, s, g,; int m[10]; cout<<"Input 10 numbers: "<<endl; cout<<"number: "; for(s=0; s<10; s++) { cin >>g; m[s]=g; } cout<<"\n"; int max, max2; max=max2=0; for(int i=0; i<10; i++) { if(m[i]>max) { max2=max; max=m[i]; } if(m[i]>max2 && m[i]<max) { max2=m[i]; } } int …

Member Avatar for askerknight
0
145
Member Avatar for Jsplinter

[CODE] vector<int> iv; iv.push_back(4); vector<int>::iterator it = iv.begin(); cout << *it; cout << *(iv.begin()); //debug assertion here [/CODE] Why can't I dereference iv.begin() directly?

Member Avatar for Jsplinter
0
279
Member Avatar for C++isC++

I have an assigment that i cant solve it , can any one help ? Here is it : .................... Write a C++ program that calculates the interest for a customer’s money at a bank account. If the customer deposit is 6000 JD or less, the bank gives an interest …

Member Avatar for MandrewP
0
100
Member Avatar for triumphost

Hey all. I'll make this quick. I want to search for a pattern and replace it with an empty string using the boost/curl libraries OR strictly c++.. No DotNet. The below code I have, removes HTML Tags from a file/string: [CODE] static string StripTags(string source) { int iSize = (int)source.length(); …

Member Avatar for vijayan121
0
307
Member Avatar for BoBok2002

I need help. I tried to load an image using SOIL. I was having problems with it so I found another code I am using. However, it looks like I am not loading it properly. It's simple but I think I'm confusing myself. I still can't wrap my head around …

Member Avatar for BoBok2002
0
5K
Member Avatar for Jdan2388

Hi I think im doing fairly good on this program but for some reason its giving me an error on line 27 this program is supposed to compute two statistical values for an array of 500 integers ranging in value from 0 to 2000 what am i doing wrong? [CODE] …

Member Avatar for Lerner
0
250
Member Avatar for mikedee7282

Can someone interpret this code for me? I dont understand whats going on. This code is supposed to take a number n that is inputted and show all the numbers below n that are frugal. A little background, a frugal number is a number where the amount of the digits …

Member Avatar for stereomatching
0
276
Member Avatar for Despairy

as you can see in the picture this happens the second i add to that kamapatchi class 1 more integer. [CODE]#pragma once #include "Configuration.h" class Kamapatchi{ public: Kamapatchi(); Kamapatchi(Point ); Kamapatchi(int,int); int getAge(); bool isAlive(); void drawSprite(char world[][BOARD_SIZE]); void eraseSprite(char world[][BOARD_SIZE]); void act(char world[][BOARD_SIZE]); void updateStatus(); string getStatusString(); string getSpecificMenu(); …

Member Avatar for WaltP
0
196
Member Avatar for toneranger

Hi, I've got stock market data in a structure as follows. [CODE]struct PriceInfo { double Open; double High; double Low; double Close; unsigned int Volume; unsigned int Time; std::string Date; };[/CODE] My program imports the data from a csv file and stores it in memory etc. The date and time …

Member Avatar for WaltP
0
2K
Member Avatar for jmaass20

im a new student to c++ and classes has really confused me. the program is creating a bank account. i have already completed the header file but the implementation file has be confused. can someone please help me with this. thanks! here is my header file: #include <iostream> using namespace …

Member Avatar for Lerner
0
133
Member Avatar for Vasthor

can anyone tell me particular code that work opposite way for "sort", where.... [QUOTE] sort(b, e) Rearranges the elements defined by the range [b, e) into nondecreasing order. Defined in <algorithm>. [/QUOTE] from Accelerated C++

Member Avatar for stereomatching
0
88
Member Avatar for codenoobrebel

Hello all, I am working on an assignment for my OOP1 class that requires reading a .DAT file, performing a bubble sort according to user input using the keyboard and then writing the sorted data to an output.DAT file. I am able to get my program to compile with no …

Member Avatar for Lerner
0
107
Member Avatar for jpico

Hi, I've been trying to write a converter that converts several units. I want it to be able to prompt the user to retype an input if they type an invalid input... I'm struggling with this part. This is what I have so far. [ICODE] #include <iostream> #include <iomanip> #include …

Member Avatar for Red Goose
0
151
Member Avatar for couldxbe

Hi everyone! I know there have been quite a few threads on this topic but I'm having a lot of trouble with one piece of code. Basically, I have an input file with three columns and 500+ rows. I want to find the average of each column, and then subtract …

Member Avatar for couldxbe
0
130
Member Avatar for ktsangop

Hello everyone! I want to add a licence expiration feature in my application (written in visual c++). When the licence expires i would like my application to generate a random numerical key which will be sent to me by the user. Using this key and a personal key-generator i would …

Member Avatar for ktsangop
1
2K
Member Avatar for mankamat
Member Avatar for nchy13

i don't know why but my compiler reads only upto insert statement. this is what compiler looks like: [B]nchy@ubuntu:~/Desktop$ g++ tree.cpp nchy@ubuntu:~/Desktop$ ./a.out 2 insert 0 14 10 85 15 70 20 60 30 50 65 80 90 40 5 55[/B] [COLOR="Red"]i want to implement following input format[/COLOR] 2 insert …

Member Avatar for jmichae3
0
117
Member Avatar for squall730

I have a homework assignment where I'm supposed to use pass by references. I'm reading my text and don't really get it. The assignment is to create a program that converts Fahrenheit to Celsius and vise versa. It's also supposed to contain a print function that will output the results …

Member Avatar for selina12
0
324
Member Avatar for charleneok

Anyone know how to do this question? Use recursion to implement the following recurrence relation f(x): f(x)=1 where =1 f(x) = f((x+1)/2) +1 where x is odd f(x) = f(x/2) +1 where x is even This is what i did: [CODE]#include<stdio.h> int func (int x) int main() { int x; …

Member Avatar for selina12
0
202
Member Avatar for gary91
Member Avatar for ladybug21

//I have this running but when the user inputs a different character than the program just out puts the error //message and that its. I want it to go back and ask the user if they would like to run the program again. Any //ideas? Thank you! [CODE]int main () …

Member Avatar for mzimmers
0
263
Member Avatar for express690

I'm having trouble writing an array program that deletes duplicate numbers in an array. I can't figure out the code for find the array size. I have the array max set to 25 but my array doesn't have 25 numbers in it. (let's say it only has 10 numbers in …

Member Avatar for WaltP
0
307
Member Avatar for phorce

Hello I'm trying to display the memory location(s) of an array of pointers. It works, but it prints the memory locations out as: e.g. [code] (0x7fff672e19a0) [/code] I know that is the memory location, but in other examples, I've seen it being displayed as [code] 4041 [/code] Here is the …

Member Avatar for L7Sqr
0
121

The End.