49,761 Topics

Member Avatar for
Member Avatar for Valiantangel

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

Member Avatar for deceptikon
0
119
Member Avatar for capton

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 …

Member Avatar for deceptikon
0
85
Member Avatar for pokie_da_codie

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;

Member Avatar for thines01
0
284
Member Avatar for FraidaL

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 …

Member Avatar for histrungalot
0
635
Member Avatar for adeel381
Member Avatar for bgx90

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 …

Member Avatar for bgx90
0
3K
Member Avatar for FraidaL

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 …

Member Avatar for WaltP
0
1K
Member Avatar for pokie_da_codie

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

Member Avatar for WaltP
0
79
Member Avatar for padraga

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 …

0
108
Member Avatar for Nathaniel10

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

Member Avatar for Nathaniel10
0
296
Member Avatar for Farmlord

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 …

0
44
Member Avatar for Griff0527

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 …

Member Avatar for Lerner
0
2K
Member Avatar for Rasool Ahmed

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 …

Member Avatar for nullptr
0
916
Member Avatar for phorce

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 …

0
277
Member Avatar for minghags

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 …

Member Avatar for minghags
0
258
Member Avatar for Sunshine2011

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

Member Avatar for mitrmkar
0
130
Member Avatar for niyasc

Is there any standard function in gcc that is equivalent to getch() so that I can read the input without hitting enter key?

Member Avatar for jaybhanderi
0
7K
Member Avatar for Valiantangel

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 …

Member Avatar for triumphost
0
93
Member Avatar for MasterHacker110

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 …

Member Avatar for BobS0327
0
1K
Member Avatar for james6754

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 …

Member Avatar for Lerner
0
259
Member Avatar for justinfritz

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 …

Member Avatar for Saith
0
313
Member Avatar for jiggaman77777

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 …

Member Avatar for ravenous
0
2K
Member Avatar for ChrisMackle

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 …

Member Avatar for sfuo
0
506
Member Avatar for poolet

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 …

Member Avatar for poolet
0
237
Member Avatar for caltech

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 …

Member Avatar for caltech
0
274
Member Avatar for benclifford

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 …

Member Avatar for triumphost
0
558
Member Avatar for ashboi

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 …

Member Avatar for ashboi
0
2K
Member Avatar for gerard4143
Member Avatar for abhimanipal

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 …

Member Avatar for mike_2000_17
0
2K
Member Avatar for c++bob1234

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 …

Member Avatar for c++bob1234
0
124

The End.