49,761 Topics

Member Avatar for
Member Avatar for DeHF

I need a little bit of help here. I'm new to C++ Classes. There are some errors which I do not know how to troubleshoot. The error of "Declaration terminated incorrectly" for line 6 and 7. Multiple errors of "Type name expected". Why is that? Multiple errors of "Declaration missing …

Member Avatar for WaltP
0
312
Member Avatar for triumphost

Hello everyone. I have a problem with my checksum and logic. I wrote a program that downloads and read bitmaps and try to generate a checksum for each one. The checksum is used as the name to save the bitmap as so that I don't save the same bitmap every …

Member Avatar for WaltP
0
160
Member Avatar for waqas94

hey guys !! i am new at c++ so i need a bit of help .. i am trying to solve different problems but i am stuck on this problem .. write a c++ function , smallestindex that takes as parameters an int array and its size and returns the …

Member Avatar for WaltP
0
115
Member Avatar for ccbuilder

Aim of the program to is read to Atmega board, which has portb which is l.e.d . When the input of +25 , it will move the stepper motor forward 25 , and negative -25 move it back. I got stuck after reading the +/- and argv1. any tutorials online …

Member Avatar for VernonDozier
0
166
Member Avatar for HacruLeian

hello, i'm confused here. i have an assignment that required me to create a project registration program that have student, project and supervisor. i haven't start to do it yet. but i've gone through the question. there's a part of the program that need to list out the student's, supervisor's …

Member Avatar for Bob
0
103
Member Avatar for andreasen12N

No, this is not an assignement. Recently I decided to pick up writing code again and the project I started writing I came to a rode block with something that I never learned in class (I don't think). How would I be able to write this better (should I stick …

Member Avatar for np complete
0
118
Member Avatar for Suzie999

Hi, I'm hoping someone might be able to help me with what I think might be a simple problem. I have came across the need to add to an unsigned char array a literal single quote "'" My question is how can I achieve that? unsigned char uArray[4]; uArray[0] = …

Member Avatar for Bob
0
126
Member Avatar for TheRazzle

Ok im new to C++ so please help, so I have this line of code. SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 3); cout << "Congratulations your power level is now" << PowerLevel << endl; insted of typing this all the time can i just add it to another cpp file and just reference it or …

Member Avatar for deceptikon
0
139
Member Avatar for samohtvii

Hi all, I am having trouble getting a tree to and from a text file. The text file will hold questions and animals. Each node should hold one question and one animal. So if you can imagine: Does it have 4 legs? / \ Does it purr? Does it swim? …

Member Avatar for samohtvii
0
3K
Member Avatar for fishsticks1907

hello, im having troblue getting my linked list to show everything on the list. it only shows the first node, and nothing afterwards. #include <iostream> #include <string> class list { private: struct node { std::string name; std::string phone; node *next; }*head, *tail; public: list() : head(0), tail(0) {} ~list(); void …

Member Avatar for fishsticks1907
0
149
Member Avatar for maurinnoe

i am having difficulties in creating an **array** that holds marks for three students each having a set of five marks, this program should allow the user to input the marks per student ,** then calculate the highest and lowest mark for each student**

Member Avatar for deceptikon
0
37
Member Avatar for vikuseth

In the below programme i use one boolean variable named check , which is being accessed inside main function by two objects of Tst1 and Test2 . But the value of check variable is not maintained in the programme . we can use static but i want to know some …

Member Avatar for ravenous
0
143
Member Avatar for inthiran115

#include<iostream> #include<cstdlib> #include<fstream> using namespace std; int main() { int n=3; float total,wait[3]={0}; float p[3],twaiting=0,waiting=0; int proc; int stack[3]; float burst[3],arrival[3],sburst,temp[3],top=3; for(int i=0;i<n;i++) { p[i]=i; stack[i]=i; cout<<"Enter arival time : "; cin>>arrival[i]; cout<<endl<<"Enter burst time: "; cin>>burst[i]; temp[i]=arrival[i]; sburst=burst[i]+sburst; for(i=0;i<sburst;i++) { proc=stack[0]; if(temp[proc]==i) { //temp[proc]=i+1;; twaiting=0; } else { twaiting=i-(temp[proc]); …

Member Avatar for Despairy
0
82
Member Avatar for sanghai45

Hi community, I wanted help in making shortest path Finder for non grid based game. Below is the image attached of which i wanted to do shortest path finding. There are nodes and each node may link to 5 or 6 nodes. I have no idea which algorithm will get …

Member Avatar for Despairy
0
164
Member Avatar for inthiran115

#include <iostream> #include <vector> #include <string> #include <fstream> #include <sstream> #include <windows.h> using namespace std; class Subject { protected: string sub_code; string sub_fac; public: Subject(string sub_code="", string sub_fac="") { this->sub_code = sub_code; this->sub_fac = sub_fac; } string getSubCode() {return sub_code;} string getSubFac() {return sub_fac;} }; class Student { protected: string …

Member Avatar for np complete
0
275
Member Avatar for sanghai45

I want to make level editor in which I want it to have three buttons CreateNode , Reset Node Create Node - It will add node in screen Reset Node - It will reset all the links from the Node And when the node is created on window if I …

Member Avatar for sanghai45
0
226
Member Avatar for breezeonhold

I'm getting the exact output I want but I keep getting an error that says "Run-Time Check Failure #2 - Stack around the variable 'c' was corrupted." Now I have to for this assignment use strncpy, and strncat and I'm trying to append two strings togethor with the max amount …

Member Avatar for m4ster_r0shi
0
141
Member Avatar for breezeonhold

I can't find the bug in my code. The error that pops up says "Expression: invalid null pointer". Visual studio isn't giving me any line to go to or really any help except once I run the program the error above pops up. The weird thing is everything compiles correctly …

Member Avatar for breezeonhold
0
275
Member Avatar for RonKevin

...Just run the program and you'll know whats wrong with it...it gives a -1 value... #include <iostream.h> #include <conio.h> void main() { int array[10],key; cout<<"Enter 10 elements:\n"; for (int c = 0; c < 10; c++) cin>>array[c]; clrscr(); cout<<"\n List of Elements:"; for ( c = 0 ; c < …

Member Avatar for RonKevin
0
339
Member Avatar for rfrapp

Hello, I am trying to fill an array with 20 unique random values between 1 and 60. I know what I need to do to get this to work, but I'm not sure how to do it. Here's what I've got: void fillArray( int arr[], int size) { int arr2[20]; …

Member Avatar for RainbowMatrix
0
2K
Member Avatar for abi_gurl

I'm creating 7x10 array that filled 0's unless it is copied by ships.Currently I'm having a problem in which I'm not sure how to place the ships inside this grid. this is how i've created the map. Please help as I'm a very beginner in c++. Thank you. void displayBoard() …

Member Avatar for abi_gurl
0
153
Member Avatar for menonlinux

I am having TurboC installed in my system. Whenever I try to run a program written in C++ using graphics.h, the screen goes blank and my LED monitor displays a change to VGA mode and suddenly displays "NO SIGNAL" and return to normal mode when I press "alt+ctrl+del" only. I …

Member Avatar for Ancient Dragon
0
152
Member Avatar for Grandiago

Hi Everyone! I'm a user of Turbo C++ and my professor gave me an activity to make a Fibonacci sequence. No I already have the Code for it and it is working. The only problem is. I don't know how the FOrmula Works. I will show you the Code below: …

Member Avatar for vinnitro
0
301
Member Avatar for PinoyDev

Good day! I knew this is easy to all of you guys. But I need the most precise way to parse this string "**45:50"** and store the result in **two dimensional array with int as datatype**. The delimeter is "**:**". Thank you!

Member Avatar for WaltP
0
321
Member Avatar for romanromeo89

I'm trying to write a simple sqlite query in c++ using visual studio 2010. My problem is that i can't use a c++ variable inside that query. I was not able to find the right syntax. `sqlite3_prepare_v2(handler, "SELECT * FROM grammateas WHERE username==X;", -1, &statement, 0);` where X i would …

Member Avatar for romanromeo89
0
746
Member Avatar for Jsplinter

I wrote the following code to test which is faster: performing a multiplication and division many times, or accessing the results in a vector via iterators(perform the calculations ahead of time), or hard coding the results of those calculations into the program. I actually expected storing the results in the …

Member Avatar for Jsplinter
0
267
Member Avatar for Despairy

I was thinking about somehow using a static member that all the matrix cells will be defined by their value + the static value. but than i thought how can i do it? what is the easiest way of doing so without the need to run over the 10^6 cells? …

Member Avatar for Despairy
0
295
Member Avatar for sampsont

I like to have the name of the current method for logging purposes. For example: string Commands::test(StringTokenizer& tokens) { static string src("Commands::test"); ... _log.debug("message", src); } I'm worried that creating 'src' might cause a performance hit. I made the string static thinking it would only be constructed once, the first …

Member Avatar for sampsont
0
139
Member Avatar for coolikedat99

I am trying to make a program that generates a random number and asks the user to input the random number generated by the computer. Anyone know how to do this? This is my program: #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { int one; time_t …

Member Avatar for RainbowMatrix
0
291
Member Avatar for streetalex310

The End.