49,761 Topics
| |
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, … | |
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; … | |
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 … | |
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 … | |
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 … | |
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; … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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: // … | |
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. … | |
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: "; … | |
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. | |
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 | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
he plz tell me how to create calulator and how we can calculate phone bill with user name and name of months..! | |
PLEASE I need help about source code of identifing token in C++ | |
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 … | |
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 | |
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 … | |
hi please help me make a username with number .. im using stdio conio ctype and string as include thanks in advance | |
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 … |
The End.