49,761 Topics

Member Avatar for
Member Avatar for Nikhar

Hi all. I'm trying to make a program where there is an array of 20 elements. Now, numbers from 1 to 20 will be assigned in a random order in the array. This is my code:- [code] #include<iostream.h> #include<conio.h> #include<stdlib.h> #include<time.h> void main() { int i,j,random_integer,count=0,sno[20]; srand((unsigned)time(0)); sno[0]=(rand()%20)+1; for(i=0;i<=19;i++) { …

Member Avatar for siddhant3s
0
157
Member Avatar for lolveley

hello, I want to make a little program with a friend method but there is a bug. In my example code, I have a class A which have the method f from clas B as friend. files: A.h [CODE=C++]#ifndef _A_H #define _A_H #include "B.h" class A { public: A(); friend …

Member Avatar for siddhant3s
1
110
Member Avatar for msteele

I'm new to c++, but I'm catching on just fine. I have a lot of experience with PHP, databases, and the like. I decided to learn a programming language that allows me to play around with things like sensors, gps devices, microphones, and anything you may plug into usb or …

Member Avatar for siddhant3s
0
92
Member Avatar for lisagk

I'm a student and wanting to know if the syntax for C++ insert/update/delete statements for adding records to a table is the same or similar to statements in SQL? I've searched and can't really find a difinitive answer for C++. ie. insert into tableName values whatever delete from tableName values …

Member Avatar for siddhant3s
0
89
Member Avatar for gretty

Hi I have a syntax problem which I dont know how to correct. The below line of code is meant to check whether the 1st character of a string is a vowel, if not, then the 1st character is sent to the end of the string & then the program …

Member Avatar for wildgoose
0
103
Member Avatar for Punkis448

Hello there! I am trying to solve a problem for a project i took and i am in the final part of it...(view below for my until now code) Well the aim is to calculate the entropy of a file and then to use Hamming to code it. I managed …

Member Avatar for siddhant3s
-1
926
Member Avatar for usman.mani

please tell me about structures and why it use in c++. what is the main advantage of use structure in c++.and about arrys what is the main differnce between arrays and structures. and give me hacking tips for yahoo messenger how can i crack my friend password.

Member Avatar for Intrade
-1
105
Member Avatar for Cloneminds

Hi there, I'm new to the site and new to learning C++. The program I am writing is for a C++ college class, and I'm just having a little trouble on if I am formatting the if statements I am using correctly. I'll give a breakdown of the assignment. I …

Member Avatar for dsladev
0
160
Member Avatar for lotrsimp12345

[CODE] Implementation file using namespace std; #include "Interface.h" #include <time.h> void timer::start() { if(! running) { begin=(unsigned int) clock(); running=true; } } void timer::end() { if(running) { finish=(unsigned int) clock(); running=false; } } int timer::elapsed() { if(running) { return((unsigned int) clock()-begin); } else { return finish-begin; } } int timer::output(unsigned …

Member Avatar for lotrsimp12345
1
289
Member Avatar for davebaum1

I am a brand new programmer attempting to teach myself C++. I understand that it is a rather complex language to begin with but I also understand it to be the most useful in the long run and one of the best building blocks for learning other languages. With that …

Member Avatar for tundra010
0
165
Member Avatar for lotrsimp12345

Here are my 3 files interface file #ifndef INTERFACE_H_INCLUDED #define INTERFACE_H_INCLUDED #include <time.h> class timer { public: void start(); void end(); int elapsed(); int subtract(); int add(); int output(unsigned int seconds); private: bool running; int begin; int finish; }; #endif // INTERFACE_H_INCLUDED implementation file using namespace std; #include "Interface.h" #include …

Member Avatar for athlon32
0
159
Member Avatar for athlon32

I'm have a small confusion, and i need a little clarification; when you make something on the heap, like this: [code=C++]int *somePointer = NULL; somePointer = new int;[/code] an int is created on the heap right? This would be the equivalent of doing something like...: [code=C++]int x;[/code] ...directly on the …

Member Avatar for siddhant3s
0
105
Member Avatar for nschessnerd

Hey, Im using readprocessmemory to get information on a game, but for some reason it skips two bytes.. part of my structure is similar to [code=cplusplus] WORD a; DWORD b; DWORD c; DWORD d; [/code] and i read the following memory into it: 00 00 FF FF FF FF 02 …

Member Avatar for nschessnerd
0
72
Member Avatar for Pavan_

[CODE] //#include<iostream> class std { public: int i; }; int main() { std A; //float f=0.0f; } [/CODE] error: ‘struct std’ redeclared as different kind of symbol error: previous declaration of ‘namespace std { }’ on compiling , above error comes. we are not including any header file.....then how compiler …

Member Avatar for Salem
0
213
Member Avatar for RiceFiend

Hello, My program runs and I have successfully written my Find and Display functions for my vector and have gotten them to work. However, my Remove and Search functions are not working; to be more specific, they are able to search for a value, but no value is found. Any …

Member Avatar for StuXYZ
0
132
Member Avatar for athlon32

I'm following a tutorial on Win32, and as I compile the examples, I'm also kinda messing with the code to experiment with different concepts. Here is a little ditty i worked with: main.cpp [code=C]#include <windows.h> #include <iostream> #include "prototypes.h" #include "defines.h" LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); void AddMenus(HWND); int …

Member Avatar for kolosick.m188
0
166
Member Avatar for lotrsimp12345

#include <iostream> using namespace std; #include "Interface.h" void timer::start() { if(! running) { begin=(unsigned int) clock(); running=true; } } void timer::end() { if(running) { finish=(unsigned int) clock(); running=false; } } int timer::elapsed() { if(running) { return((unsigned int) clock()-begin); } else { return finish-begin; } } int timer::output(unsigned int seconds) { …

Member Avatar for waldchr
-1
84
Member Avatar for kolosick.m188

I have this code being called by a QMainWindow: [code=c++] centralWidget()->currentWidget()->addSubWindow(new SubWindow()); [/code] the centralWidget is a QTabWidget the currentWidget is a QMdiWindow and I get the error: [icode] error: 'class QWidget' has no member named 'currentWidget' [/icode] please help

0
79
Member Avatar for dharm93

Attached is my code. I posted this twice on accident earlier, and I didnt attach the code which caused the users discomfort. My problem is that i keep getting a segmentation fault and I can't understand why. The problem occurs during the decryption part of the program. My other question …

Member Avatar for VernonDozier
-1
179
Member Avatar for sdmahapatra

[quote]I've written below simple code.Actually need to do that the value which is given by an user that will use as macro and macro value will automatically initialyzed to all needed place.Not to given every time.[/quote][CODE]#include<iostream> #include "conio.h" #define AB def() int main(int argc, char* argv) { int a=3,b=2; int …

Member Avatar for sdmahapatra
0
136
Member Avatar for tundra010

Hi I have Microsoft Visual C++ 2008 Express Edition and I downloaded fltk from fltk.org. When I tried compiling it, i got many of these errors: LINK : fatal error LNK1181: cannot open input file 'fltk.lib' How do i compile FLTK now? Please help

Member Avatar for tundra010
0
269
Member Avatar for ashikthomas

[B]Hi, I want to lit up toggle keys' status LEDs. Anyone please suggest me some methods. I know that the bits of the byte 0x417 keep track of the status of the keys whereas the bits of the byte 0x418 only monitor whether the keys are pressed or not. The …

Member Avatar for Ancient Dragon
0
71
Member Avatar for nahmartin

My apologies my c++ abilities are poor (self taught) I have a text file that needs editing the first 10 lines of the file needs replacing but the other 1,000,000 + lines don't I need the information in the first 10 lines to know what to edit them to i …

Member Avatar for nahmartin
0
135
Member Avatar for Creator07

Hello, I was doing a test Win32 Project. I am using the standard rename() function under cstdio. My program was not working. So, while tracing, I got the return value of rename function as [B]-1[/B]. I have not seen anywhere, rename(0 function returning -1. Could anyone tell me what's wrong. …

Member Avatar for Creator07
0
198
Member Avatar for gretty

hi my program is supposd to deleted repeated (identical) array elements within an array. Although its not working but I can figure out why? Also is there a more advanced way of doing this; checking for repetitions in an array? I am not sure but maybe using stringstream? I am …

Member Avatar for Lerner
0
94
Member Avatar for wacky

I work in Visual C++ ,Win32 aplication and I want to play more sounds together and I don't know how. I used PlaySound() but this function play only one sound at a time. If you have some solutions post them here please. Thank you!!

Member Avatar for athlon32
0
349
Member Avatar for kangarooblood

I've been trying to do a really easy game here, the thing is that the when a player reaches 0, it just keep going to -5 and such like. WHat's wrong? [code=c++] #include <iostream> #include <cstdio> #include <cstdlib> using namespace std; int main () { srand(time(0)); int player1 = 100; …

Member Avatar for bunnyboy
0
107
Member Avatar for Jordaan

Hey all. I'm working on an implementation of a d20 character (think Dungeons and Dragons, but more general purpose), and for my implementation of feats, I've created a feat class, with a series of function pointers to represent events that feats might effect (getting skill bonuses, calculating crit damage, etc). …

Member Avatar for Tom Gunn
0
66
Member Avatar for dsladev

Hey everyone, well I wrote this program because I haven't seen anyone do it yet (it has always been random numbers, not sentences.) Also I just wanted to see if I could do it :). Im posting this not because I need it fixed, although I'll tweak it if I …

Member Avatar for kolosick.m188
0
519
Member Avatar for compumax

Hi. I am creating own compiler/linker. What is the most standard and recommended way to use binary libraries? (such as user.obj,gdi.obj) Is it better take them from Windows directly, from some version of Visual Studio, or exist special SDK distributions? Thanks.

Member Avatar for compumax
0
88

The End.