49,761 Topics
| |
can u pls explain to me the use pf srand function & its syntax?i tried the following coding.it compiled,but runpage is not getting displayed. [code=cplusplus] #include<iostream.h> #include<stdlib.h> int randomno(); int main() { int i; cout<<"ten random numbers for the range 0 to 50"<<endl; for(i=0;i<10;i++) { randomno(); } return o;} int … | |
my output keeps putting out monday for everything need help with this, kinda confused on what im dooing [CODE]#include <iostream> #include <iomanip> using namespace std; void displayTitle(); int getMonth(int month); int getDay(int day); int getYear(int year); int CalcDayofWeek(int month, int day, int year); void displayDay(int G); int main() { //declare … | |
I've been over this all day and it looks fine to me. Yet it is crashing my program, so I know there's an error here. I'm fairly certain the error exists in the getvalue function [code] int main () { char thevalue[1024]; char needle[25]; char haystack[2048]; memset(thevalue,0,sizeof(thevalue)-1); memset(needle,0,sizeof(needle)-1); memset(haystack,0,sizeof(haystack)-1); strcpy_s(haystack, … | |
Is there a difference between a class and a struct? At first I thought a struct could not have methods/constructors/destructors, but now I found out they can, so what is the difference? | |
Help with a c++ code to convert base 10 to base representation using stacks and queues ADTs protocols. | |
Hello, I am doing a file input/output. I wrote 3 fulls names, phone number, balance. etc inside my input file. Example: John Doe 555-555-5555 5000.00 In my output file, I am trying to create this output with using setw. First Name Last Name Phone Number Balance ------------ ------------ ----------------- --------- … | |
When I have [ICODE]sizeof(utmp)[/ICODE], 384 is returned. So when I try to find out the size of the individual members, I get a different result. Using the method below, I come up with 382 bytes. Anyone know where I'm missing the other 2 bytes? [CODE=CPP] #include <iostream> using std::cout; using … | |
fatal error C1075: end of file found before the left brace '{' at '.\project4.cpp(75)' was matched i am getting an fatal error and dont understand how to fix it, most help is appreciated [CODE] #include <iostream> #include <iomanip> using namespace std; void displayTitle(); int getMonth(int month); int getDay(int day); int … | |
The following steps tell how to create a project file to play a wav sound file 1- create a project file. 2-Choose Console Application in Basic tab. 3-After Create the Project File go to Project Option 4-Choose Parameter tab 5-Click the Add Library or Object 6-Browse the location of Dev-c++ … | |
Before I start, I'm sure you've all seen this error, and explained how to solve it many times before, and for that I thank you for bothering to read this, and if you choose to answer, I wish to thank you in advance. So, the issue I am having is … | |
What is the way to convert this int to a std::string. I have searched MSDN and found that itoa could be used (vs atoi for string to int as I know how it is done). Though I cant find any good example that shows how itoa is used or if … | |
I am using a "GriedViewControl" with 14 columns and with this code below I can set the number "1" to the First Column and 21 Rows down. What I wonder is how I access for example [COLOR="Green"]column 3 and row 1[/COLOR] or [COLOR="green"]column 4 and row 2[/COLOR] etc... What is … | |
I have to write a program to read 10 integers into an array. It will then read in one more integer. My program should then compute and output how many distinct pairs of integers in the array add up to the last number that was input. Note I cannot use … | |
The error is: F:\C ++ Numerical Methods\Newton_Raphson.cpp(199) : fatal error C1004: unexpected end of file found [code=C++] #include <cmath> #include <iostream> using namespace std; double F ( double X ) { return pow ( X, 4) - 9*pow ( X, 3 ) - 2*pow (X, 2) + 120*X - 130; … | |
This has been driving me nuts for the last half hour or so. Google didn't help. I don't know which function returns the nth character in the string. I know that it is supposed to be something like this stringname.something(n?) If someone could post the function and an example of … | |
Hey there; I've run into a problem! I have a program that is supposed to do multiple things. Therefore - I have a menu (switch statements). Is there any way I can make it so when 1 statement finishes, it can go back to the main menu? I can add … | |
hi im new to c++ and at the moment trying to write a program that generates random numbers and then sorts those numbers using bubblesort. So far ive managed to get the random numbers working but i am unable to sort the random numbers with bubblesort ? [code] #include <iostream> … | |
hi i am new to eclipse i wrote a small programm in c++ using operator overloading if i compile normally no error but if compile through eclipse it is giving erorr message like "operator not mached " /*************************************************************/ this my main.cpp ************************************************************/ [code=cplusplus] #include <iostream> #include"use.h" #include"friend.h" using namespace std; … | |
I am confused in tellg funtion can any body tell me its syntax also for seekg();. | |
Hi, I want to use linked list in the linked list. In the following code i would like to introduce new public member as species which has four to five members. How to modify the code to add new member species? In the class TREE, I would like to add … | |
Hello, I am having a problem for coping the string into a 2d array.. Also if the length of the string is more than 16 bytes how to continue to read till end of string.. Can anyone help.. [code=c++]int encrypt() { string text = "Encryption"; char b1[4][4]; text.length(); strcpy(text,b1); // … | |
I am having trouble figuring this out. I only have one error and it is in main. I am trying to write a program that will output first just a random sudoku type grid(function called random), then I am trying to output a sudoku type grid that has no duplicates … | |
1st off, Im new to C++ programming. I created a function to calculate garage parking charges. I keep getting this last error: HourFee.cpp(65) : error C2065: 'ROW_SIZE' : undeclared identifier this is my error ---> ***int vehicleInfo[ROW_SIZE][COLUMN_SIZE];*** [code=cpp]void calculateCharges() { int x; int r; for (x=1; x<=10; x++) const int … | |
Hi i have my code that finds every instance of my search criteria in a text file and tells me the position in the text file it is located at. The next step i want to do is stream the bytes that follow each instance of my search criteria into … | |
Hi guys, I have an input file as below (it is a family tree): 1 0 0 2 0 0 3 0 0 4 1 2 5 1 2 6 0 0 7 3 4 8 5 6 9 7 8 10 7 8 where column 1 = individual number … | |
Hello, I'm new to programming and I have a simple project to plot a graph using gwin. The graph should just be a series of circles curving upwards on the y axis, the amount of plots should be defined by the user. I think I have everything almost correct but … | |
SO here it is; start with an array that couts random numbers I used the generate function now check those numbers if they repeat so return true if false is returned then you can go onto the next random_integer to check..here I use the contains function the problem is generate … | |
Hey guys, new poster here. I'm rather desperate here, I just do not understand the concept of templates very well. I've used the search function, but I don't see the problem addressed in any other threads. Any help is much appreciated. My assignment is to create a templated vector class … | |
the string is to be split using operator overloading as Krishnamoorthy(pointer member operator)m(pointer member operator)moorthy | |
i am unable to understand the logic to be used. can u pls help me write the program |
The End.