49,757 Topics

Member Avatar for
Member Avatar for margeaux54

I have a problem that ı could not understand. [CODE]#include <cstdlib> #include <iostream> #include <stdio.h> using namespace std; struct record { char name [20]; double ave; }; int main(void) { int x,y; struct record array1[3]; struct record array2[3]; FILE *a; a=fopen("in.txt","r"); for (int i=0;i<3;i++) { fscanf(a," %d",&y); array1[i].ave=(x+y)/2.0; cout << …

Member Avatar for caut_baia
0
81
Member Avatar for yuugib

Hi, I was wondering if you can help me figure how to go about this problem. This is what I have to do: Write a programme to generate an array of 100 random integers. [B]While the array is being filled incrementally, produce a sorted array by comparing the new element …

Member Avatar for yuugib
0
212
Member Avatar for Hojjat.Mojallal

There are n persons numbered from 0 to n - 1 standing in a circle. The person number k, counting from the person number 0, is executed. After that the person number k of the remaining persons is executed, counting from the person after the last executed one. The process …

Member Avatar for Hojjat.Mojallal
0
374
Member Avatar for az_ez

Hi, I've been working on this code but recently there's been a problem with a section of my code, this being that there was a stack overload but now, the code just stays in a loop saying that there is an invald arguement. I don't know how to get it …

Member Avatar for az_ez
0
347
Member Avatar for bkoper16

I am doing a project for school that requires me to make a program that asks the user to enter a date by selecting two options for the format 1.MM/DD/YY (in numbers) 2.Month ,DD, YY (with the name of the month entered) both options should then display the date in …

Member Avatar for thelamb
0
174
Member Avatar for rohitamitpathak

i m confused about sprint syntax- i need to create dynamic mysql query so i have to use it, when i take char * it shows a error while when i take char arr[100] (like this )it work fine.. i read syntax from sprint from multiple sites, and it make …

Member Avatar for rohitamitpathak
0
266
Member Avatar for mpassaglia

Hello DaniWeb! I've been struggling with a small detail of this program for a few days now, and haven't come up with any solutions on my own. The basic gist of the assignment is to fill an array with random numbers, sort it, and then search for a number in …

Member Avatar for mpassaglia
0
404
Member Avatar for subith86

Hi friends, I know this is such a freak code, but out of curiosity I did it to see memory usage increase using new operator. [CODE]int main() { char* a; for (;;) { //cout<<&a<<endl; a = new char[10]; } }[/CODE] As you see line7 is commented. When i run this …

Member Avatar for subith86
0
142
Member Avatar for ronthedon

I have a program where I have to put an input file in. Can someone tell me which direction to go in to where i can have my program calculate the data from the input file?

Member Avatar for frogboy77
0
50
Member Avatar for lxXTaCoXxl

Okay so I know practically nothing about creating mathematical applications in C++ but am trying to learn. Practically everything I search for isn't anything close to what I need. Basically, I need to lean how to make a calculator style app first before continuing on, however I can't find anyone …

Member Avatar for pseudorandom21
0
223
Member Avatar for mpike

Ok! so im making a simple highscore type thing. the person plays the game and receives a score within the game. At the end of the game i have it currently comparing the score received with the score already in place within the highscore text file. the problem im having …

Member Avatar for arkoenig
0
148
Member Avatar for manutd

This is a function that will find the factors of a given number for you. EDIT: Better algorithm using vectors (thanks all at cprog :) )

Member Avatar for lxXTaCoXxl
0
178
Member Avatar for programing

hi . plz I need you to explain for me how i can write a function that return the mod of array with n value . i think mod is that sample mode is it ? i am try to solve . but my code print the number taht is …

Member Avatar for WaltP
0
2K
Member Avatar for Gryphon75

Hello everyone, this is my first post. I am working on a school assignment and I am stuck. The assignment involves reading a file that contains course subjects and the maximum number of students that can take the class. The contents are entered into an array sorted alphabetically by the …

0
38
Member Avatar for Michael_Tanner

I've been snooping around trying to figure whether or not this was completely safe. I've noticed that if you were to simply "delete this" you might have occurrences where the deleted pointer is still in use elsewhere in the program. To prevent this, you'd need to dereference it and perform …

Member Avatar for Michael_Tanner
0
145
Member Avatar for bantex07

Please Help how can i delete a lines from may .txt file someone help me :D my .txt file had a data please so body help me :D:-/

Member Avatar for jonsca
-1
60
Member Avatar for nory22

hi there am wondering about the space between the [COLOR="red"]"[/COLOR] and the [COLOR="red"]%[/COLOR] scanf([COLOR="red"]"[/COLOR] [COLOR="red"]%[/COLOR]c",&choice); what's the different if i leave no space?

Member Avatar for Narue
0
132
Member Avatar for LevyDee

I am writing an importer for a custom export script to load mesh information for models. I tested my algo with small files, 20-30 kb of information with success, but when I try something bigger like 400kb(not that big mind you), the file fails to open. This is the significant …

Member Avatar for Kanoisa
0
145
Member Avatar for ntrncx

ok lets say that we have the numbers 5,67 and 128 (the numbers are randomly entered) i want in first loop read the last digit means 5,7,8 in the 2nd pass i want the tenths so will be 0,6,2 in the 3rd will be 0,0,1 and so on. what i …

Member Avatar for ntrncx
0
206
Member Avatar for Szeth

Hello, I have this on going project for my C++ class, dealing with a random number generator guessing game. I'm on the last step, finally. I gotta add functionality to output the array of guesses to a file after the answer has been guessed, and I need to include exception …

Member Avatar for Szeth
0
211
Member Avatar for narlapavan

first i am creating socket, with that socket descriptor i am sending some no. of bytes through sendto(....) function. At the time of receiving through recvfrom(....) function, my code was hanging if the specified destination address is not available. Suppose if destination is available the it's working correctly... Why this …

Member Avatar for dkalita
0
220
Member Avatar for UltimateKnight

Hey. As you know I'm a newbie in C++ and I'm learning from some source codes and eBooks. I don't know if the problem is to me but when I try to compile the code an error shows. I don't know if I should copy this code but I read …

Member Avatar for UltimateKnight
0
326
Member Avatar for az_ez

I've been trying the last few days to get this code to work but it still wont return the exact numbers. Its always atleast like 10 characters off and it probably is a trivial answer but I cant find the solution. I've initialized the charCount to 0 but still it …

Member Avatar for WaltP
0
134
Member Avatar for Igor Vinícius

Hello World, I'm a c++ beginner and i've diced to study. So this is my first code: [CODE] #include <iostream> using namespace std; double d = 2.2; int i = 7; void some_function() { d = d + i; i = d * i; printf("%d\n", d); printf("%d\n", i); } int …

Member Avatar for Igor Vinícius
0
155
Member Avatar for taumang

i want to know the sequence of values tobe printed out by this algorithm count = 0 while(count<2) print the value of x x=x+2 else print the value of x my answers are as follows 0;2 i need clarity

Member Avatar for taumang
0
106
Member Avatar for DaniwebOS

Regardless of what I do, the program won't run without crashing... any luck on how to fix it? [CODE]#include <iostream> #include <string> using namespace std; class DayOfTheWeek { public: void setDay(string); void printDay(); string getDay(string&); string plusOneDay(int); string minusOneDay(int); string addDays(int); private: int day; int toNumber(string); string toName(int); }; int …

Member Avatar for jonsca
0
105
Member Avatar for Lelly

Hello, I started my homework and I couldn't complete it. Can anyone help me with it?? the question is: Implement the depth-first search algorithm so that it accepts input from text file in the following format: List all distinct vertex symbols (use just a single symbol: A-Z and 0-9) one …

Member Avatar for mike_2000_17
0
181
Member Avatar for NV43

In my set.h file - template(class T): [CODE]template<class T> class set { public: void add(const T& item); private: } #include "set.template"[/CODE] In my set.template file: [CODE]template<class T> void set<T>::add(const T& item)[/CODE] In my main.cc file (where cset1 and cset2 are both set<char>): [CODE]cset1.unian(cset2);[/CODE] The error: [CODE]error: no matching function for …

Member Avatar for mike_2000_17
0
169
Member Avatar for Tinee

I have made a program which the user will input the total inputted numbers and record it as an array, sort the biggest and smallest number, post the original inputted number, reverse the original's order, and lowest to high order. I have done the recording, sorting, however, when the program …

Member Avatar for Arbus
0
175
Member Avatar for daviddoria

I am working on some code (not written by be, and too big to fundamentally change the structure of) where a pure virtual Image class is implemented. The user is expected to implement a function of their derived Image class with signature: [code] virtual Rgb* GetRgb(); [/code] Where the Rgb …

Member Avatar for mike_2000_17
0
266

The End.