49,761 Topics

Member Avatar for
Member Avatar for bramprakash1989

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 …

Member Avatar for Ancient Dragon
0
244
Member Avatar for infernojmd

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 …

Member Avatar for vmanes
0
96
Member Avatar for kireol

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, …

Member Avatar for kireol
0
104
Member Avatar for CoolGamer48

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?

Member Avatar for sarehu
0
71
Member Avatar for MONYE

Help with a c++ code to convert base 10 to base representation using stacks and queues ADTs protocols.

Member Avatar for vmanes
0
38
Member Avatar for NinjaLink

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 ------------ ------------ ----------------- --------- …

Member Avatar for NinjaLink
0
260
Member Avatar for TheFueley

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 …

Member Avatar for TheFueley
0
168
Member Avatar for infernojmd

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 …

Member Avatar for sarehu
0
88
Member Avatar for danibootstrap

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++ …

Member Avatar for penguina888
0
211
Member Avatar for Ice_Dragon

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 …

Member Avatar for Narue
0
112
Member Avatar for Jennifer84

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 …

Member Avatar for Jennifer84
0
188
Member Avatar for Jennifer84

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 …

Member Avatar for Jennifer84
0
99
Member Avatar for Draghen

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 …

Member Avatar for Majestics
0
2K
Member Avatar for mzdiva041986

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; …

Member Avatar for mukulbudania
0
120
Member Avatar for deactivated

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 …

Member Avatar for Ancient Dragon
0
96
Member Avatar for DaveCachia

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 …

Member Avatar for Ancient Dragon
0
92
Member Avatar for ichigoSJ

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> …

Member Avatar for dougy83
0
100
Member Avatar for veeraiyan

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; …

0
44
Member Avatar for Majestics

I am confused in tellg funtion can any body tell me its syntax also for seekg();.

Member Avatar for Majestics
0
103
Member Avatar for maheshkumar

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 …

Member Avatar for Ancient Dragon
0
104
Member Avatar for kartouss

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); // …

Member Avatar for vmanes
0
5K
Member Avatar for coolbreeze

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 …

Member Avatar for Ancient Dragon
0
77
Member Avatar for TheOneNOnlyQ

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 …

Member Avatar for Ancient Dragon
0
759
Member Avatar for tootypegs

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 …

Member Avatar for vijayan121
0
140
Member Avatar for andyg55

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 …

Member Avatar for Lerner
0
164
Member Avatar for warchilo

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 …

Member Avatar for Salem
0
230
Member Avatar for ckins

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 …

Member Avatar for ckins
0
112
Member Avatar for doublediamond

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 …

Member Avatar for doublediamond
0
211
Member Avatar for bramprakash1989

the string is to be split using operator overloading as Krishnamoorthy(pointer member operator)m(pointer member operator)moorthy

Member Avatar for Narue
0
215
Member Avatar for bramprakash1989
Member Avatar for Narue
0
209

The End.