49,761 Topics

Member Avatar for
Member Avatar for Thembelani

hie guys l have basic knowledge of c and c++.Recently we were given a project assignment on statistical modelling we have to implement it using c/c++.I researched on the libarries that l can use eg sdl,openGL,what l wld like to noe is it possible to code using gcc in linux, …

Member Avatar for mike_2000_17
0
1K
Member Avatar for lizziekadango

help me out, it says rand cant be used as a fuction when compiling. #include <cstdlib> #include <iostream> #include <math.h> #include <ctime> using namespace std; int main(int argc, char *argv[]) { int i,rnumber,number,power,base,rand; int randomise();//initialises random number generator srand(time(0)); cout<<"ten random numbers from 0 to 99\n\n"; for(i=0;i<10;i++){ rnumber= rand()%100; cout<<rnumber<<endl; …

Member Avatar for lizziekadango
0
159
Member Avatar for DelilahDemented

The program runs and gives the correct data until it gets to the 4th line of the input. At the 4th line, the calculation is incorrect and when it gets to line 6 of the input, it just stops completely. I can't quite figure it out. Any help is greatly …

0
137
Member Avatar for Pelle_3

I can't seem to figure this out. The multidimensional array "structure" changes its values without any reason. I am using Visual Studio 2010 for debugging, and when it enters "structure[x][y] = readData" for the first time, it changes the array's value, but it changes back on next line. I don't …

Member Avatar for deceptikon
0
150
Member Avatar for DelilahDemented

I have a program that is supposed to match opening and closing braces. It's supposed to work like a stack. It works until the last line of the input file. The last line is matching, but because it thinks the array size is zero it drops out and states that …

Member Avatar for DelilahDemented
0
189
Member Avatar for Koji01

hi guys...i have a problem concerning strcmpi not equal while inside a while loop. Check out my code below: #include<stdio.h> #include<conio.h> #include<stdlib.h> #include<string.h> main() { char yr[4],new_yr[4]; int x=0; FILE *fp1; printf("Enter Year: ");scanf("%s",new_yr); printf("\n"); printf("You Entered Year %s\n\n",&new_yr); if(strlen(new_yr)==4) { fp1=fopen("year.txt","r"); while(fscanf(fp1,"%s",yr)>0) { if(strcmpi(yr,new_yr)!=0) { fp1=fopen("year.txt","a"); fprintf(fp1,"\n%s",new_yr); fclose(fp1); x=1; …

Member Avatar for Koji01
0
119
Member Avatar for mikesr

Hi! I'm trying to read wstring from file. This is an file content example: "83 118 269 ... " The number 83 represent "S", 118 represent "v", 269 represent "č", and so on.. So, I tried to read the numbers into int. But the problem is, that I don't know …

Member Avatar for mikesr
0
171
Member Avatar for siram1

write a programe that read amount of money ranging from rm0.10 up to rm5.00(multiple of 10cents). Display number of coins that can be used tp form the above amount. eg. input=rm1.40 , output: 50cents=2, 20cents=2, 10cents=0

Member Avatar for Despairy
0
81
Member Avatar for CharlieSeuss

http://www.daniweb.com/software-development/cpp/code/216342/menu-on-a-windows-form-for-dev-c I recently used this page to develop a menu for a program I am attempting to design. However, instead of using "Load" and "Save" functions under "File", I wish to have the list of conintents under a "Continents" tab. I later plan to have the continent options lead to …

Member Avatar for KaeLL
0
141
Member Avatar for PseudoGuard

Here is the assignment (Part A). In this part you will write a function to generate random numbers in a specified range. Specicially we want you to write a function named generateRandom that generates a single random number in a range specified by the user. The function takes two integer …

Member Avatar for KaeLL
-1
286
Member Avatar for Jorox03

I am writing a program which converts a Gregorian calender date to a Julian day number. I am having some problems implementing the portion which includes time. For reference - http://en.wikipedia.org/wiki/Julian_day (scroll to calculation section) My code: jdn_t gregorian_to_jdn_with_time( year_t year, month_t month, day_t day, hour_t hour, min_t min, sec_t …

Member Avatar for Jorox03
0
197
Member Avatar for adityasingh95

i need to create a ball bounce program where the ball would be of a user defined radius, it would bounce inside a rectangle of user defined length and breadth and it would start by falling from the center of the box at a certain angle. the box would be …

Member Avatar for nannan001
0
91
Member Avatar for SAM2012

I have a queue class code is given below: struct ListNode { ListNode(int value); int value; ListNode* next; }; ListNode::ListNode(int value): value(value), next(nullptr) {} public class queue { public: queue(); ~queue(); bool Empty() const; int Next() const; void Enqueue(int value); void Dequeue(); void DisplayAll() const; int getP() const; private: // …

Member Avatar for SAM2012
0
285
Member Avatar for k-nat
Member Avatar for myk45

Hello All! i just created an executable in Windows(xp) and opened it up on Notepad++ and saw some strange comments: > Stack memory around _alloca was corrupted > A local variable was used before it was initialized > cast to a smaller data type has caused a loss of data. …

Member Avatar for myk45
0
135
Member Avatar for pendo826

i need to restrict the user from inputting an integer and string when inputting a char. I have a method for an integer i just need to adapt it for a char. Can anyone help me with this. char getChar() { char myChar; std::cout << "Enter a single char: "; …

Member Avatar for Lucaci Andrew
0
196
Member Avatar for nishad_forums

Hi, I have googled but found nothing about this. I am trying to generate a random number from a given array. But how do i do it? **Suppose:** I have an array `int arr[]={3,89,99,4,55};` and i want to generate a random number among these numbers. thanks in advance.

Member Avatar for nishad_forums
0
310
Member Avatar for prince.chindah

hello pls i need a kind person to teach me any programming language, any! but i prefer c++, or java. pls i need ur help!!! yes u that is reading this now. thanks

Member Avatar for MandrewP
0
178
Member Avatar for TexasJr

This is the code I have right now : cout << "==============================\n"; cout << setprecision(2) << fixed; cout << "Shelby" << setw(24) << shelby << endl; And this is the output: ============================== Shelby 25.81 But what I'm trying to do is add a "$" sign before the amount while keeping …

Member Avatar for vijayan121
0
186
Member Avatar for sarafadeenl1

Hi guys, am new here .Pls am a student and i want to build a search engine for my school using C++. how do i go about it. Your response is greatly appreciated

Member Avatar for sarafadeenl1
-1
202
Member Avatar for superchica08

Combining queue and stack link list? hello so here is my question i ave to connect a link lists together, one who behaves like a stack the other like a queue.the numbers used are 11 22 44 77 33 99 66. so the stack link list looks like this 66 …

Member Avatar for Lerner
0
1K
Member Avatar for superchica08

How to display odd and even numbers from a queue link list? hello everyone i really need some help right now on this program. what this program is supposed to do is copy 11 22 44 77 33 99 66 into a linked list that behaves like a queue. the …

Member Avatar for chaau
0
4K
Member Avatar for soccer909

I am writing a program. In the program, I have to compact as many songs with total time under 80 minutes into a CD. I have to also have the program output the total time remaining on each CD. AND I have to have the program output the total time …

0
71
Member Avatar for Atif.Abbasi

he plz tell me how to create calulator and how we can calculate phone bill with user name and name of months..!

Member Avatar for Ancient Dragon
0
40
Member Avatar for SHAHAB UDDIN
Member Avatar for Rishabh876

so i was trying to make a binary tree program. just inserting and deleteing. some how i messed up. i think insertion is ok till level 1 after that stays on level 1 only. also the function to delete the whole tree is not working. it only deletes node at …

Member Avatar for Rishabh876
0
314
Member Avatar for JuliaCplus

I need to write a program to enter 3 names then display the name is aphabetical order. Example Jessie, sam, and chris. the program should display: chris Jessie sam Please help

Member Avatar for NathanOliver
0
915
Member Avatar for HunainHafeez

with a lil bit of change in code ,it's functioning, but I want it to function with data members being private :-/ #include<iostream.h> #include<conio.h> class account{ public: int account_number; float balance; int passw; public: void display() { cout<<"Account number is:"<<account_number<<endl<< "Account balance is:"<<balance<<endl; } void user(int acc, float amou, int …

Member Avatar for HunainHafeez
0
184
Member Avatar for nheziscute22

hi please help me make a username with number .. im using stdio conio ctype and string as include thanks in advance

Member Avatar for NathanOliver
0
302
Member Avatar for PseudoGuard

In this part you will write a function to generate random numbers in a specified range. Specicially we want you to write a function named generateRandom that generates a single random number in a range specified by the user. The function takes two integer parameters representing the lower and upper …

Member Avatar for deceptikon
0
1K

The End.