48,985 Topics

Member Avatar for
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
101
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
126
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
112
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
84
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
119
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
160
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
283
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
185
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
137
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
320
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
137
Member Avatar for jetdreamer

hey guyz... i'm new here... i just want to know how i could end my program after a certain amount of time has passed by... I'm doing a "text twist" program where after 2.30minutes and if the user still has not guessed the correct answer, the program will end... i'm …

Member Avatar for unbeatable0
0
203
Member Avatar for anny**

hi! to everyone i have to make a program in c++ about factorial but the main problem is that the working of factorial must me shown for eg. 4!=4*3*2*1 like this on the output screen i had done upto here.... [code=cplusplus] #include <stdio.h> #include <conio.h> int main() { long float …

Member Avatar for sidatra79
0
258
Member Avatar for tatainti55

How can i run my program for a specific amount of time? And what is threading? I'm really new to C++ so i'd like n00b-friendly answers.

Member Avatar for Freaky_Chris
0
71
Member Avatar for Gary_nel

Hi Im new to the whole thing of programming and would like to write a C++ program to copy files from one drive to another, any help and suggestions on where to start? Any help with source code or pointers will be greatly appreciated. The OS the program is for …

Member Avatar for dougy83
0
130
Member Avatar for c230jif

My instructions are to write a program that assigns a five-word phrase with a single space between words to a user-defined string variable. It then outputs each word of the phrase separately. It must use the phrase "This is a test phrase" in the output, but also function properly when …

Member Avatar for Freaky_Chris
0
102
Member Avatar for rodeostar04

I would appreciate if anyone could help me with my program that calculates a hand of black jack. I know the way I created this program is probably not the most effective way but the only thing I seem to have problems with is getting the program to add 10 …

Member Avatar for Salem
0
123
Member Avatar for DeadJustice

I'm trying to read in the chars for a file in order to compare two text files. The problem is I can't seem to load space characters into my vectors. Any suggestions for me? [CODE] vector<char> cyphVector; char c; //fill vector with cypher file chars while( cyphFile.good() ){ cyphFile >> …

Member Avatar for VernonDozier
0
117
Member Avatar for rhoit

I am trying to built the program for handling polynomial... using linklist.... and so far i tried to implement in the Class to add the 2 polynomial using the operator overloading i got messed up with the some objects.... i have commented the parts please help..... [CODE] #include<iostream> using namespace …

Member Avatar for sarehu
0
139
Member Avatar for STUDENT#101

Hi could anyone tell me how to compile a three tear program in VC++. I am using g++ in school and so for practice at home I am using VC++ but I just can't get it to compile. thanks in advance.

Member Avatar for AceofSpades19
0
145
Member Avatar for DemonGal711

Ok, this is probably really stupid, but I'm lost and want someone else to say what they think. My teacher gave us an assignment and said that everything was in the file she sent us. So, I opened it and filled in all the coding as far as the comments …

Member Avatar for DemonGal711
0
78
Member Avatar for rodeostar04

I would appreciate if anyone could help me with my program that calculates a hand of black jack. I know the way I created this program is probably not the most effective way but the only thing I seem to have problems with is getting the program to add 10 …

0
164
Member Avatar for sinrtb

[code]return tree == NULL ? -1 : tree->height;[/code] I am trying to understand AVL trees but the one really nice example I found has a couple of methods defined like this. It is really pretty but I cannot read it? Can someone explain it to me? Or even just write …

Member Avatar for Narue
0
151
Member Avatar for freelancelote

Hi, is it possible to find out the size of an array created on the free store? thanks

Member Avatar for freelancelote
0
120
Member Avatar for patricksquare

//challenge,, fix this! [code=cplusplus] #include<stdio.h> #include<conio.h> void main() { struct job{ int at; int bt; }; struct job J[80], cpy[80], temp, cpy2[80]; int q, oh, jbn, x, y, z, t, ref=0, tt[80]; again: clrscr(); textcolor(YELLOW); gotoxy(20,5); cprintf("*** ROUND ROBIN WITH OVERHEAD ALGORITHM ***"); textcolor(10); gotoxy(5,7); cprintf("How many jobs do you …

Member Avatar for bhoot_jb
0
185

The End.