49,757 Topics

Member Avatar for
Member Avatar for Geard2

I was wondering in a doubly linked list how do check to see if the initial list you have is Null? This what I have (would this be correct): [code] node *middleOut(struct node*LL) { node *current = LL; if(current == NULL) { cout<<"empty list"; } //Rest of code is down …

Member Avatar for Bhoot
0
29
Member Avatar for sunveer

the below code is to allow user to enter many strings of characters until he enters a fullstop (.) Please tell me how can i calculate the total number of strings the user has entered. #include <iostream> void main() { char a[80]; int i,c=0; for(i=0;;i++) { cin>>a[i]; if(a[i]=='.') break; } …

Member Avatar for bhoot_jb
0
122
Member Avatar for STUDENT#101

hi all! how do I multipluy values inside the array I have tied the following but the compiler is giving me a error double a=(h[0]*b[1])+......

Member Avatar for Freaky_Chris
0
114
Member Avatar for StephanJos

Hi! Can anybody please help me to add many strings in one? I tryied this int a=4,b=5,c=6; string d; d = #a+" Hello "+#b+" bye "+c; I want that d = 4 Hello 5 bye 6 Please help me!

Member Avatar for Ancient Dragon
0
187
Member Avatar for core2d

I have this problem where you have a list of odd or even number of items in doubly link list and you have delete the middle one. For the even number one you delete the two middle elements, say you have 1,2,3,...,10 you delete 5 and 6, and for the …

Member Avatar for Sky Diploma
0
130
Member Avatar for ae012

hello! im trying to make a program where entered values should be displayed in a tabulated form. however, as far as i know, everytime we enter a value and press ENTER, the cursor goes to the next line. is there any way where in if a user enters a value …

Member Avatar for ae012
0
88
Member Avatar for jeevsmyd

hii friends..Am new to this community... am a computer science student... I need your help in creating a small c++ game... Its a project for me... I am told to do it in turbo c++... okay... the game is so simple... [U][I][B]A number memory game... random numbers should be displayed …

Member Avatar for Sci@phy
0
641
Member Avatar for shiniboy

[code=cplusplus] #include <iostream> #include <iomanip> #define _USE_MATH_DEFINES #include <cmath> using namespace std; double meanOf3(double value1, double value2, double value3) { double mean; mean = (value1 + value2 + value3)/3; return (mean); } int main() { float value1, value2, value3; double mean; mean=0; cout <<"Enter the first integer whose square root …

Member Avatar for Sky Diploma
0
136
Member Avatar for monogana

hi all, here is a question - all files on windows have certain attributes - readOnly, Archive ect.... how can i add my own custom attributes - Note - i dont want an interface to use them just to be able to get and set them within a c++ program …

0
59
Member Avatar for nomarhere

i need help with a homework problem, it's writing a program that approximates the sum of 1 + x/1! + (x^2)/2! + (x^3)/3! + ... + (x^n)/n! we're supposed to write a program that takes a value x as input and outputs this sum for n taken to be each …

Member Avatar for grumpier
0
83
Member Avatar for unk45

im supposed to create an address book and so far have gone as far as getting the input..my problem now is the highlighted section..i have to return bak the info put in initially by the user (first, last name and address), based upon a question to the user to input …

Member Avatar for stilllearning
0
230
Member Avatar for CPPRULZ

I tried to make a simple function that takes an array parameter and outputs it and it keeps giving me th error: \function test.cpp(12) : error C2664: 'func' : cannot convert parameter 1 from 'int' to 'int []' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast …

Member Avatar for vidit_X
0
294
Member Avatar for Geard2

I am new to link list and I have this problem where you have two lists. One list pointed by HEAD has a list of numbers in it, and the second list pointed by LARGE that contains the highest element(s) in the list pointed by HEAD. Each element has three …

Member Avatar for stilllearning
0
111
Member Avatar for JackDurden

Im having real trouble seeing this, how do I delete something out of a linked list if it is already there? My current delete function just deletes everything out of the list. the text file contains numbers like this: 75 85 95 25 35 75 85 95 25 [CODE]#include <iostream> …

Member Avatar for JackDurden
0
82
Member Avatar for paulo_war

can i have a sample of a working lexical analyzer??plss...i need it for my project..

Member Avatar for paulo_war
0
103
Member Avatar for luisvega

I have a vector of strings "moves" [code]std::vector<string> moves;[/code] and the Chars: [code] char fromX, toX, fromY, toY; [/code] I use: [code] sscanf(moves[0], "%c%c %c%c", &fromX, &fromY, &toX, &toY); [/code] and Compiler says: [code] error: no matching function for call to 'sscanf(std::string&, const char[10], char*, char*, char*, char*)' [/code] What …

Member Avatar for Ancient Dragon
0
127
Member Avatar for shiniboy

[code=cplusplus] if(minrange<maxrange) { cout <<"The numbers that are divisible by " <<increment<<" are "; cout <<endl; for(count=minrange; count<=maxrange; count++) { if(count%increment==0) { cout <<count <<" , "; sum1 = sum1+count; } } [/code] this is the code that i wrote. The code is working fine. However, my problem is that …

Member Avatar for Ancient Dragon
0
113
Member Avatar for jammy's

#include<iostream.h> #include<conio.h> #include<process.h> const int max=5; class stack { int s[max]; int top; int temp; public: stack (int j,int p){top=j;temp=p;} void push(int item); void pop(); void display(); }; void stack::push(int item) { if(top<4) { top++; s[top]=item; } else { cout<<"\nStack is full!"; } } void stack::pop() { if(top>-1) { cout<<"\nThe …

Member Avatar for ArkM
0
123
Member Avatar for jammy's

[code=cplusplus] #include<iostream.h> #include<conio.h> #include<process.h> const int max=5; class queue { int r; int f; int q[max]; int temp; public: queue(int l,int m,int p){r=l;f=m;temp=p;} void insertrear(int item); void deletefront(); void display(); }; void queue::insertrear(int item) { if(r<(max-1)) { r++; q[r]=item; } else { cout<<"\nQ is full"<<endl; } } void queue::deletefront() { …

Member Avatar for Ancient Dragon
0
85
Member Avatar for Talli

can someone make a simple program that prints numbers in series depending on the persons input .. for eg :- if input is 5 then output should be : 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 ....please help asap .. thank you …

Member Avatar for Talli
0
129
Member Avatar for freelancelote

Hi, during an assignment I needed to write a function that, among other things, had to print some of an array values. The simplified version that I show below creates an array of 50 pointers, populates it, and prints the values from main and from a function. I'm really struggling …

Member Avatar for freelancelote
0
120
Member Avatar for Se7Olutionyg

[QUOTE] * Calculates and displays: o The number of square centimeters of material that are needed to manufacture a specified quantity of flat washers o The weight of the left-over material, after the washers are stamped. In order to calculate the leftover weight - you will need to determine the …

Member Avatar for Lerner
0
208
Member Avatar for peter_budo

:o Hi there!!!!!! May I ask for help? After holidays all my C++ knowledge gone. What I need is to create string from integer number and another string as STRING = INTEGER + SUFFIX where INTEGER is 5 SUFFIX is than 'th' so STRING is 5th

Member Avatar for Talli
0
285
Member Avatar for core2d

I have an assignment to write a pseudo-code to have a list pointed by H (list of numbers) that have to be copied to a list pointed by H1 (only the odd numbers need to be copied). Can anyone tell me if I am wrong on this (not a working …

Member Avatar for bhoot_jb
0
187
Member Avatar for tatainti55

Why do i get this error every time i try to compile an SDL source code? D:\gcc installation problem, cannot exec `cc1': No such file or directory. That's the ONLY error i get.

Member Avatar for tatainti55
0
112
Member Avatar for mugun

hello everyone....i need some help,i am using c++ and vectors, and text files to create a library system and i have a problem.....i used a vector named v1 and i was trying to use an if else to assign a created vectors elements value to another value example like v[10] …

Member Avatar for ArkM
-1
139
Member Avatar for sanchyvil

Hi I want to know how to compile c++ codes using the command prompt in windows. In linux I do [code]g++ filename.cpp -o filename[/code] and run it using [code]./filename[/code] but for windows when I try this procedure in compiling i got an error message [quote]'g++' is not recognized as an …

Member Avatar for sanchyvil
0
336
Member Avatar for sunveer

i want to know what are the lower triangle and upper triangle mean in a matrix. For eg: if matrix is [ 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 ] then what will the lower triangle and upper triangle in this …

Member Avatar for ArkM
0
94
Member Avatar for luisvega

Hi, i have a problem with a vector. I declare a vector<char*> moves; in header. Code: [code] void LogView::init(){ int a = 0; while (LogFile.good()){ LogFile.getline(line, 6); moves.push_back(line); cout << "vector :"<< moves[a]<< endl; // here is OK a++; } moves.begin(); cout << "vektor :"<< moves[1]<< endl; // here is …

Member Avatar for luisvega
0
2K
Member Avatar for needhelp83

I am brand new at C++ and I have a programming assignment I have to do. I have to create a directed graph and perform a breadth-first traversal. I have to use an adjacency linked list implementation without using any existing libraries as Standard Template Library. Where do I begin? …

Member Avatar for needhelp83
0
138

The End.