49,756 Topics

Member Avatar for
Member Avatar for MattyRobot

I have been trying to get world coordinates of the cursor position for a program by: [LIST=1] [*]getting the top and left position of the client of the window [*]getting the global position of the cursor (GetCursorPos()) [*]cursor x - client left and cursor y - client top [*]zoom x …

Member Avatar for MattyRobot
0
89
Member Avatar for GooeyG

I'm in the process of designing a battleship game and I need some help of why I'm coming up with a error. The error is:error C4430: missing type specifier - int assumed. Note: C++ does not support default-int. Another question is, how would i randomly place the battleships in the …

Member Avatar for mrnutty
0
261
Member Avatar for slim2hott

I have learned c++ over a long period of time and i have decided to use it to create windows programs with it. Right now, I am just practicing. I have made a window with three menus at the top. when you click one of the menuitems, a dialog box …

Member Avatar for garthus
0
153
Member Avatar for AdRock

I have a string and I need to split the string into tokens The word can contain and letter/number but can also contain punctation such as brackets I need to be able to find an occurence of punctuation, copy the string up to that point as a token, copy the …

Member Avatar for Tom Gunn
0
255
Member Avatar for chubzyko

Hello guys! can you give me an example on how to switch lines or records inside a textfile? I need to enter 2 numbers, there are 3 numbers inside the textfile, which also means it has 3 lines. [QUOTE]1 name 2 name 3 name [/QUOTE] 1st number entered= 2 2nd …

Member Avatar for chubzyko
0
183
Member Avatar for SCoder1

Hi I can't seem to get this right I've looked online but I can't find the right page. I'm trying to make a simple program that takes a number but what if a character is entered. Well so far I get "140" as an answer. Here's what I mean in …

Member Avatar for SCoder1
0
93
Member Avatar for Nixriq

I have a program that is aonly reading the first line of the input from an input file, and i cannot seem to figure out why it wont read the rest 10 lines in the input file. Attched is the code, the input file and the output i get when …

Member Avatar for Nixriq
0
156
Member Avatar for achyuthan1991

Can anyone please tell me how to input a fingerprint from a usb fingerprint reader which gives fingerprints in xpm format? The reader is of the company Lumidigm.. It is Lumidigm venus v300

0
40
Member Avatar for komrul_raja009

What is conditional operators ? Using conditional operator find a smallest number amongst two numbers ?

Member Avatar for dkalita
0
65
Member Avatar for kashmir323

I am creating this simple program that will capture screen shots. I want to make it so the name of the image that is saved is what the user enters into a text field before the picture is taken. and if at all possible is there a way to make …

Member Avatar for thefly
0
764
Member Avatar for wameed

Hello all; This is my first contribution in this forum>>> please help me.^_^. I have a project in c++. I uae Microsoft visual C++ 6.0. I want to make the column be able to resize using a mouse. "column resizable". can you help me in some codes as soon as …

0
52
Member Avatar for neilsam

im working on a program for my exams and its not really working.....cant really figure out why........i ran my program in both borland and turbo.....and both are giving the same error......DECLARATION SYNTAX ERROR. [CODE]void mul(int a[][3],int b[][3]) {int k=0; for (i=0;i<3;++i) { for(j=0;j<3;++j) { c[i][j]=0; for(k=0;k<3;++k) c[i][j]=c[i][j]+(a[i][k]*b[k][j]); //Multiplication of two …

Member Avatar for neilsam
0
108
Member Avatar for johndoe444

Hi, With the piece of code: [CODE] 1 #include <stdio.h> 2 3 typedef struct { 4 int x; 5 int y; 6 } addr; 7 8 typedef struct addr a; 9 10 int main() { 11 addr array[5]; 12. printf("%d\n", sizeof(array)/sizeof(addr)); 13. return 0; 14. }[/CODE] Having this error: nettest.cpp:8: …

Member Avatar for Clinton Portis
0
68
Member Avatar for johndoe444

While using socket library of c++, I find the following pointer (servinfo) to the library function getaddrinfo. Now I need to know the array size of the pointer servinfo (allocated by the library function) so that I can access each element of the array. How can I get the size …

Member Avatar for Clinton Portis
0
82
Member Avatar for osgiedeprof

Please can anyone out there help me see the problem with this piece of code? I’ve tried running it on the visual studio compiler But either get warnings or undesired output. I supposed the code to be a little dictionary that compares Inputs with some set of predefined ones and …

Member Avatar for Lerner
0
165
Member Avatar for ninreznorgirl2

I'm not quite sure how to fix it. I have done the debugger on it, and it seems that it might have something to do with the cin.get() but im not sure. [CODE]void MyFloat::Read() { char ch; int k = 0; cin.get(ch); while( ch == '0' || isspace(ch)) cin.get(ch); if …

Member Avatar for Lerner
0
132
Member Avatar for chubzyko

I've been surfing the net for hours now looking for a good example of reading and sorting data from a textfile.:pretty: But I can't find a good one that is working. :(Can somebody give me a simple example code of reading and sorting data from a textfile in ascending order …

Member Avatar for Lerner
0
2K
Member Avatar for Nixriq

I am new to this website, and coding as well, so please bear with me. I have a program that i'm trying to fortmat the output into a single line. The output should read : HHHHHTTTTT Number of Heads: 5 Number of Tails : 5 where the values change per …

Member Avatar for Clinton Portis
0
127
Member Avatar for restrictment

Hello. I really need help with adding graphics. I have skimmed through multiple tutorials, but all of them have been wicked long, and I honestly don't know how to execute them properly. So I was wondering if any of you had a [b]code snippet[/b] that would allow me to add …

0
89
Member Avatar for Kl2eativ

I need to add sound to this code but I cannot figure it out! Help!! [CODE]#include <iostream> #include <cstring> #include <cctype> using namespace std; int main() { int i, j; int iL; char alph[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; char *morse[] = { ".-" , "-..." , "-.-." , "-.." , "." , …

0
40
Member Avatar for kingcrim05

I'm getting the same very large number for item and for each element in the array after that for loop is done. Why am i not pulling the 6 numbers from my input file? Thanks. [code=c] #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main(int argc, char *argv[]) …

Member Avatar for Ancient Dragon
0
115
Member Avatar for r30028

I have a quick question regarding precision printing output to cout. I need a way to print a MINIMUM number of decimal place digits to cout and also possibly have a maximum number of decimal places printed. Also, I need a way to "undo" if you will a call to …

Member Avatar for r30028
0
135
Member Avatar for power_computer

I have the following driver for my template class the parameter being passed to the template is another class, the error I get is Error line 28 : templateclass.h std::ostream<<ballteam is illegal driver.cpp line 30 Where instationating templateclass<ballTeam>::print const () driver [code] #include <iostream> #include <fstream> #include "arrayListTypeT.h" #include "ballTeam.h" …

Member Avatar for power_computer
0
138
Member Avatar for EngneerNitemare

Student Problem: "I am trying to get the code below to compile which is from my textbook [I]"C++ How To Program (6th Edition)"[/I] Fig. 4.9. However, I keep getting the "Fatal Error LNK1561: Entry Point Must Be Defined" every time I try to build the code." What I Know So …

Member Avatar for Grn Xtrm
0
103
Member Avatar for Doughnuts

Hi, I am trying to use strings, and even a simple program like this doesn't work. [CODE]#include <iostream> #include <string> int main() { string Hello; Hello = "Hello world!"; cout << Hello; cin.get(); }[/CODE] I am using Borland C++ 5.0, and it gives me this error. "String does not name …

Member Avatar for Doughnuts
0
121
Member Avatar for fragtech

In my c++ book they give a program that finds the prime numbers between 1 and 100. The problem I am having trouble understanding is the logic of the second for loop. I know what it does but not how, if that makes any sense. [CODE] #include <iostream> using namespace …

Member Avatar for mrnutty
0
532
Member Avatar for DMC[au]

Hi, I've been writing a program that encrypts and stores passwords (it's for uni, I'm a newbie), and I'm having a problem with some misbehaving variables. I hope someone can shed some light on it for me. :) I have a function which takes a string as a parameter and …

Member Avatar for DMC[au]
0
256
Member Avatar for jmoran19

Hi, I'm looking for help writing a program to check an input file for errors in its pattern. Basically, I've got a file of thousands of lines like this: "70 20000731 210202 19 36005 354 55.369 -37.207 -54 0.847 491 0.981 0.985 278977" I have no trouble opening the file …

Member Avatar for jmoran19
0
110
Member Avatar for hezfast2

Hello, I've attached my code, I keep getting the Debug Assertion failed, Expression: string subscript out of range error I can't find any errors in my logic and code for the functions, but obviously something is wrong, no matter where I put breaks, i still get the error when debugging. …

Member Avatar for StuXYZ
0
534
Member Avatar for abdelhakeem

hi all i need some help with time.h for in the following: i want to make a programme in which while time is 12:00 PM, It prints a Web-page USING time.h thx,,,, kim00000

Member Avatar for abdelhakeem
0
170

The End.