49,761 Topics

Member Avatar for
Member Avatar for rithish

#include <iostream.h> void main() { int d; int i=0,n,j,b[100]; cout<<"\n Press 1 for Decimal to Binary converstion"; cout<<"\n press 2 for Decimal to Octal converstion "; cout<<"\n press 3 for Decimal to Hexadecimal converstion"; cout<<"\n\nEnter your choice: "; cin>>d; switch(d) { case 1: cout<<"\nEnter decimal number: "; cin>>n; while (n>0) …

Member Avatar for phorce
-2
415
Member Avatar for Lostelf

Hi everyone I'm having a problem with this program giving me the wrong output. The question is • void getScore() should ask the user for a test score, store it in a reference parameter variable. This function should be called by the main once for of the six scores to …

Member Avatar for rithish
0
378
Member Avatar for diknas

#include <conio.h> #include <iostream> using namespace std; int main() { int A[10][10],m,n,x,y,sum=0; //Create a Matrix cout << "Enter number of rows and columns in Matrix A : \n"; cin>>n>>m; cout << "Enter elements of Matrix A : \n"; for(x=1;x<n+1;++x) for(y=1;y<m+1;++y) cin>>A[x][y]; //Find sum of each row for(x=1;x<n+1;++x) { A[x][m+1]=0; for(y=1;y<m+1;++y) …

Member Avatar for phorce
0
270
Member Avatar for gizmo7008

I'm not sure what I'm doing wrong. I get a warning when I compile and an error after my program runs. This is the warning I get: myList2.cpp: In function ‘int main()’: myList2.cpp:96: warning: deleting array ‘int score [6]’ And this is what shows after my program runs: a.out(7023) malloc: …

Member Avatar for gizmo7008
0
248
Member Avatar for bearsomg

Hello, I am currently building a rendering engine in native C++ using Direct3D 10 and the Win32 API. The engine will have 2 separate windows, one being the rendering window and the other being a control window which is used to load models, animaitons, etc. It is also used to …

0
99
Member Avatar for godzab

The difference between using refrences(&var), and pointers(*var) is that using refrences is more efficent because you do not have to derefernce the object. Am I right, and if I am why use pointers then? Take this code for example: #include<iostream> //function prototype void rFunc(int &rNum); void pFunc(int *rNum); //main method …

Member Avatar for deceptikon
0
96
Member Avatar for triumphost

I've hook a game that uses OpenGL and I'm trying to draw text on the window but when drawn, it has a background that I do not want. Currently i'm using: void glPrint(HDC DC, COLORREF Colour, int X, int Y, const char* format, ...) { if (format == NULL) return; …

Member Avatar for triumphost
0
378
Member Avatar for DeeperShade

Ok, i'm trying to create vertex normals for each vertex. I'm fairly sure i've got the math right, I'm just having trouble finding out to which faces a point belongs... The points are store in: `vector <texTri> texvert` texTri contains, x, y, z, nx, ny, nz, u, v; I identify …

Member Avatar for DeeperShade
0
320
Member Avatar for BlitzX

I'm writing a program that searches for particular sequences of bytes in a USB stick. The problem is that I don't know how to search effectively. ReadFile() allows me to buffer 512 bytes each time. If my sequence is fully present in that block, then there is no problem. But …

Member Avatar for BlitzX
0
120
Member Avatar for silvercats

#include <iostream> #include<string> using namespace std; int main() { string admin_pwd="testing"; string encrypted ; string unencrypted; char key[5] = "abcd"; for (int x=0; x < admin_pwd.size(); x++){ encrypted += admin_pwd[x] ^ key[x/100%30]; } cout << "Encrypted = " << encrypted<<endl; for (int x = 0; x < admin_pwd.size(); x++){ unencrypted …

Member Avatar for WaltP
0
2K
Member Avatar for nstruzik

Im pretty new to coding in C++ and Im a student at devry unversity. I have to sort this class by credit hours in ascending order and Im having some trouble. If anyone could help it would be greatly appreciated. #include <iostream> #include <string> #include <vector> #include <algorithm> using namespace …

Member Avatar for Ancient Dragon
0
217
Member Avatar for triumphost

So... I'm looking into learning Assembly. I downloaded the FASM assembler and I want to know how useful is assembly? I want the opinion from Cpp programmers because assembly programmers always tell me it's the best language -__- Also quick question: How do I know which register to put stuff …

Member Avatar for DeanMSands3
0
157
Member Avatar for kenneth.goh.754

I'm doing a project that require the user to type in the phonetic sounds for example, "th". then the program will play a wave file that produce th sounds. As there are many different wave files for a phonetic sounds, i decided to group them into separate files, which means …

Member Avatar for speakon
0
630
Member Avatar for osiron

Hey guys, I created a Student class in a header file and it works just fine. The problem is I'm trying to store the Student objects into a map in main which made the compiler generate a "in file included from ..." error. I'm having trouble fixing this problem as …

Member Avatar for osiron
0
179
Member Avatar for dlmagers

Alright, I need a program that has both a selection structure and a repetition structure. Would someone please tell me if I am doing this right. My code gives me the correct output but do I have a selection and repetition structure? #include <iostream> using namespace std; int main () …

Member Avatar for MasterHacker110
0
222
Member Avatar for MasterHacker110

In C++ you have this: std::string = "Name"; You can also read file with it, unlike reading the contents into a char[] with a limited amount of memory. So whats is C equivalent of a C++ string?

Member Avatar for MasterHacker110
0
3K
Member Avatar for dlmagers

I am trying to figure out how to create a C++ program that has a Subtotal and a Grandtotal. Could someone please help start a program? It has to have a selection and repetition structure in it.

Member Avatar for phorce
0
753
Member Avatar for dot_binary

From what I've heard to be able to play two or more sounds at the same time, the sounds must be loaded in to multiple threads.On the documentation for PlaySound() I haven't seen anything about this, can some one tell me how to do that.

Member Avatar for Banfa
0
170
Member Avatar for Chuckleluck

Hello, Over the past couple of days, I've been struggling with getting collision detection to work for my game, a 2D sidescrolling platformer, made with SFML 2. This is example code using my most recent method of collision detection, although it has some flaws: // main.h #ifndef MAIN_H #define MAIN_H …

Member Avatar for Chuckleluck
0
631
Member Avatar for dot_binary

Hello! After I compile and run my program a windows error message shows up, it doesn't give some specific information it's just a standard windows xp error that asks me to send report. It gives me the error because in my code I have some basic math like this: int …

Member Avatar for dot_binary
0
300
Member Avatar for myk45

Hello All! I am a little confused about the memory allocated for an executable. Now, say for example, this is my code: int foo = 1; int main() { const char* bar = "hello world"; int num; return 0; } Now, the "hello world" part would be stored in the …

Member Avatar for myk45
0
290
Member Avatar for triumphost

How can I get SetConsoleTextAttribute to work with my Console? I tried everything. First I redirected the cout and cin buffers so that my console can have input and output. But now it doesn't have Colour :S I used: HANDLE OutputHandle = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(OutputHandle, 10); I don't think GetStdHandle is …

Member Avatar for triumphost
0
321
Member Avatar for WellCom34

What would be the possible reason why my code display two reasults whenever i search for a record that is in the second row or higher, first it display the first records and then it display the record i am searching. example output: ->Enter ISBN : A200 then the output …

Member Avatar for deceptikon
0
162
Member Avatar for txikiting

Hello, I want to convert a WORD type to a string, I have this code: FileTimeToSystemTime(&fdFile.ftLastWriteTime, &SysTime); String numday = SysTime.wDay; But i says that operation connot be done because it's a WORD what I wan to insert to a String. And my question is, is there any function/way to …

Member Avatar for Schol-R-LEA
0
361
Member Avatar for triumphost

How can I create PNG Files from an array of bytes or read a PNG file to create an array of bytes? I looked up the format but it looks nothing like a bitmap and I read the GDI doesn't support PNG's. So how does LibPNG do it then? I …

Member Avatar for DeanMSands3
0
300
Member Avatar for capton

Hello 'am working in qt creator but have problem running my code. It compiles alright but never executes. And also gives the following message at the output pane 'exited at code -1073741819' Please help me out

Member Avatar for capton
0
130
Member Avatar for eswar.ch.35
Member Avatar for Rouf mir

Can someone tell me how to implement priority queues using arrays.Please help!!!!!!

Member Avatar for princysharma90
0
118
Member Avatar for hastingo

i need a help ..im trying todoa course work about fingerprint matching is anyone has link or source code??

0
88
Member Avatar for osiron

Hey guys, So I've been working on a program that takes a student id and name but however I got a weird error saying: error: expected ‘(’ before ‘.’ token error: expected ‘{’ before ‘.’ token and it occurs around the `name_first(firstName), name_.second(lastName)`. I'm having trouble to get the pairs …

Member Avatar for osiron
0
103

The End.