49,761 Topics
| |
I hav this code below.How can i use Macros , so that i can change at random "-" and " " without searching through the codes? #include <iostream> using namespace std; int main() { int row,col,n; cout<<"Enter an Integer number:\n"; cin>> n; cout<<("Numerical Pattern\n"); for ( row = 1 ; … | |
Please i'm having problems sorting nodes in a linked list but i can sort the data members and i want to know if sorting the nodes themselves in the list is necessary at all. In other words are there instances where nodes are specifically needed to be sorted. Also, why … | |
Instead of using User input , how can I take an parameter input and convert it to a string, where I can than check for for input values. char values[17] = "0123456789ABCDEF" ; char numIn[15]; int num[15]; int ob, nb, i; | |
This is a minor issue that I'm having in a larger program. The program is for factoring a second degree polynomial. The function below is supposed to find the factors, which is does, but let's say a=6, b=1, c=-12 so a*c=-72 and I want the two numbers that will add … | |
This is my first time to try using STL maps. The code looks correct as far as I can tell, but when I try to compile a test file that does nothing but include the header for the class and declare a variable of that class, I am getting compiler … | |
This code is supposed to find the nth prime number (n being input by the user). I have the code to calculate whether a number is prime or not, but I don't know how to get the code to display the nth prime number. #include <iostream> using namespace std; void … | |
Can anyone help me make a code or advice I need a code that takes 2 parameters eg. integer 123 and base number from 2 to 16. Using argv[1] and argv[2] any help greatly aprreicated | |
Hi, I am quite new to C++, Currently, I'm learning how to do a problem which will take a text file of thousand most common words in the english dicatonary with another text file. After finding how many words are in said text file show the percentage of which are … | |
I have searched for and read through over 50 examples of linked lists. I can barely make heads or tails out of them. Some are in C, some are in Java, some use templates, most only discuss theory and display flowcharts but have few explained examples. I need serious help! … | |
Hi there just doing some work where i need to produce a database in C++ for DVD now I have done most of it but I’m stuck on some bits. I have split the database up into different files but I will post the files which are important. I just … | |
| I have pretty much failed my class (4 weeks behind in an 8 week class that is currenlty at the beginning of week 8), but I am wanting to learn C++ for myself anyhow. I have visited http://www.cplusplus.com/doc/tutorial/ and gone through the tutorial, but cannot understand this assignment. I have … |
Hi guys, I'm programming a firewall and so far I have complete the driver coding, but I don't know **How to send IRPs from user applicatio to the dirver?** I have used `IoCreateSymbolicLink` to establish the connection between the usermode and kernelmode but I don't know how to send information … | |
Hello, I have been reading an article on comparing data, and have been given this code: for(i = 0; i < matrix1W; i++) { for(j = 0; j < matrix2H; j++) { diffSum += abs(matrix2->pData[(row+j)*backW+(col+i)] - marix1->pData[j*matrix2+i]); } } Now it works when using arrays, but, I'm using vectors, is … | |
Hello! I want to ask you guys if anyone can help me correct my current program to read graph from a file instead of adding manual matrix in program. Example graph: graph.txt 8 1 2 3 1 3 6 1 8 1 2 3 2 2 8 2 3 4 … | |
#include <iostream> using namespace std; class test { public: int bla(int &c); }; int test:: bla(int &c) { c=100; return c; } int main() { int c=10; test student; int b=1; switch(b) { case '1': cout<<student.bla(c); break; } cout<<c; return 0; } I would like to change the variable c … | |
Is there any standard function in gcc that is equivalent to getch() so that I can read the input without hitting enter key? | |
hi i am trying to change an input from upper case to lowercase.I am not getting it right.When i key in say Liverpool or TIGERS it only show l and t respectively. Need assistance #include <iostream> #include <cctype> #include<iostream> using namespace std; int main() { char s; cout<<"Name your favourite … | |
I again have a C code that i need in c++ #include <stdio.h> void hexDump (char *desc, void *addr, int len) { int i; unsigned char buff[999]; unsigned char *pc = addr; // Output description if given. if (desc != NULL) printf ("%s:\n", desc); // Process every byte in the … | |
I wrote about this the other day but do not think I explained it too clearly...I shall try again... So my problem is this...when I am trying to allocate memory to a pointer, it fails. This is my MatrixClass definition.. class MatrixClass { public: MatrixClass(int m, int n); MatrixClass(void); virtual … | |
I am having trouble with this part of my program assignment. I have created and compiled the three separate implementation files that design the three classes, they each have a default constructor, overloaded constructor, and a display function. //************************************************************************************************************ "When your program is working correctly, define an array of pointers … | |
I'm having a problem getting the number of integers greater than the average in my array to display. I keep getting "You have 1 number greater than the average when there are 5 that are greater. Pls help!!! This is the code I've devolped so far: #include <iostream> using namespace … | |
So im learning SDL to get an idea on game programming for my career as a game developer. I havent done any learning for a couple of months after getting stuck on this problem. So im using a lazyfoo.net tutorial engine. that moves a player and has a collision with … | |
If someone can simplify this code I will appretiate since I don;t have time... !!!! Thank you in advance..!! Regards..!!! CODE::: #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime> #include <stdio.h> #include <stdlib.h> using namespace std; int DisplayMenu(); //function that display the menu of the program int Quit(); //quit function … | |
In my code below you will see at the bottom my very lame attempt at sorting the vector array of employee records by name, alphabetically. My friend tried to tell me how I'm supposed to do it, but I can't make any sense of it really, so if someone could … | |
I am trying to use the size of an array to determine how many entrys are in the array as follows sizeof(array)/sizeof(array type) = number of elements in the array. I then wish to use this to add more data to the array as follows array[sizeof(array)/sizeof(array type)] = new Object(object … | |
I'm trying to write a program that uses vector to store the grades for the number of students entered.But i seem to be getting some problems with my code. I am able to enter the number of students, but when it asks for the grades, the program exits. I hope … | |
Please delete this...I'm new to the new Daniweb format. | |
Hi everybody, Please excuse the noob question as I am new to STL in C++. I am trying to write a very basic program which uses iota. However my compiler is complaining that iota does not exist in algorithm. Some other forums suggested including <backward/algo.h> as iota could have been … | |
Define a base class person that will contain universal information, including name, address, birth date, gender and identification (student, worker etc). Derive from this class the following classes: Student Worker Student_worker Add variable school to student and company to worker class. Write a program that asks user to input information … |
The End.