49,757 Topics

Member Avatar for
Member Avatar for Mr_PoP

TIMERS.h: [CODE]#include "includes.h" class servtime { public: int sec() { int sec; time_t rawtime; tm * timeinfo; time(&rawtime); timeinfo=localtime(&rawtime); sec=timeinfo->tm_sec; return sec; } int mint() { int min; time_t rawtime; tm * timeinfo; time(&rawtime); timeinfo=localtime(&rawtime); min=timeinfo->tm_min; return min; } int hour() { int hour; time_t rawtime; tm * timeinfo; time(&rawtime); …

Member Avatar for Mr_PoP
0
349
Member Avatar for v_janssens

Hi there, Im a structural engineer (so excuse my limited knowledge of C++ and programming in general) and write analysis programs using microsoft visual studio. I've developed a few programs that run within VS but am wondering how I would go about making these stand alone apps/programs anyone could use …

Member Avatar for v_janssens
0
3K
Member Avatar for hannesvdc

Hi all, I want to make my own widgets in c++, but don't know where to start. I didn't find any examples, tutorials,... on google. I know there are some toolkits like qt, gtk+, wxwidgets, and i've used them already, but i want to make some myself. Qt says to …

Member Avatar for hannesvdc
0
1K
Member Avatar for SpecialForce

Hello, I am trying to create a program to read text from clipboard. It works great, but when I copy a file the program crashes. I am trying to make it to ignore any files and only output text. My code so far is the following: [CODE]#include "stdafx.h" #include <iostream> …

Member Avatar for Ancient Dragon
0
149
Member Avatar for SpecialForce

Hello, I am trying to upload a file via ftp using the library curl. Of course I looked [URL="http://curl.haxx.se/libcurl/c/example.html"]here[/URL] but the exemples don't say how to do this using usarname and password. Aslo the code is in C and if I compile it in C++ I am getting: [CODE]error C2664: …

Member Avatar for SpecialForce
0
2K
Member Avatar for headedtomexico

this was probably a bad idea to begin with since i've never messed with multithreading or the sapi... but i got the sapi working on its own, but when I put it in its own thread it wont speak anymore. I've tried over and over and over.... i'm not sure …

Member Avatar for donaldw
0
422
Member Avatar for nalasimbha

Hello, I have a dll that I wrote and a driver program to call that dll. Both the programs were written in VC++ 2008 express edition. The program takes in 2 strings as a command line argument and passes it to the dll which prints the 2 strings in the …

Member Avatar for Narue
0
303
Member Avatar for Mr_PoP

[CODE] time_t rawtime; struct tm * timeinfo; char sec [80]; char min [80]; char hour [80]; char year[80]; char month[80]; char day[80]; time ( &rawtime ); timeinfo = localtime ( &rawtime ); string timetest; timetest= strftime (sec,80,"%S",timeinfo); timetest= strftime (min,80,"%M",timeinfo); timetest= strftime (hour,80,"%H",timeinfo); timetest= strftime (year,80,"%Y",timeinfo); timetest= strftime (month,80,"%m",timeinfo); timetest= …

Member Avatar for Mr_PoP
0
87
Member Avatar for meensatwork

Hello, Is it possible to use ctypes for this? I tried a sample code from net but it is not working. [CODE]from ctypes import cdll myDll = ctypes.LoadLibrary('C++dll.dll') mydll.testString()[/CODE] Can u tell me how to load a C++ dll and call the functions from python?

Member Avatar for TrustyTony
0
1K
Member Avatar for joinerc

Hello All, I've been learning C++ recently and my question pertains to inheritance. What I have is code like this: [CODE=cpp] class shape { public: virtual void print_type()=0; double delta() //acts the same on all shapes }; class sphere : public shape { public: void print_type() { cout << "this …

Member Avatar for joinerc
0
138
Member Avatar for bbman

Help random numbers rand() returns same numbers I am trying to make a blackjack program which uses srand() with time as seed to determine random number of card between 1-10. Two problems, one is that the first three returned numbers are always similar and one digit or so more than …

Member Avatar for Narue
0
163
Member Avatar for Firsum

This is a simple game that I am bringing to a close. It is called Slash and Smash. The goal is to defeat the last opponent, who is a champion of the arena. In the game player can use potions for health and energy,go to sleep, heal up, eat and …

Member Avatar for jember
0
350
Member Avatar for sairakhalid

I need to know the syntax of how i can read a string from a file without using char array or char variable. i want to declare a variable of string type but its giving error . I have include <cstring>,<ctype> libraries. int main() { string s1; ifstream fin fin.open("myfile.txt"); …

Member Avatar for mraza1_ch
0
281
Member Avatar for ctyszkiewicz

Hello Outline of the problem: Files: 1. a.cpp, a.h, atest.cpp 2. b.cpp, b.h - file a.cpp is compiled to liba.so - file b.cpp is compiled to libb.so - function af01 defined in a.cpp calls the function bf01 defined in b.cpp - file atest.cpp is compiled to executable program, which calls …

Member Avatar for ctyszkiewicz
0
144
Member Avatar for GeekInTraining

Hi, me an my friend are creating a program that requires locating files, which requires knowing the file path. We came across functions to find the user name of the current person logged into windows, and to find all the logical drives on the target computer. We need help passing …

Member Avatar for Ancient Dragon
0
232
Member Avatar for shiny27

Hi, I'm having trouble with the following code and any help is greatly appreciated. [CODE]/*########################################################################## ### The problem should prompt the operator to enter the number of competitors, followed by the scores awarded to each by the 5 judges. Scores can range from 0.0 to 6.0 in increments of 0.1. …

Member Avatar for WaltP
0
101
Member Avatar for Peter_morley

When I initialize my grid array I have no problem initializing it changing my row values like so grid[0][0] = 0; grid[1][0] = 0; grid[2][0] = 0; grid[3][0] = 0; ...but when I do this "grid[0][1] = 0;" or "grid[0][2] = 0;" and all the way up to 8 the …

Member Avatar for Peter_morley
0
217
Member Avatar for Mr_PoP

[CODE] int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst;[/CODE] but how can i call it , i mean like if i wanna cout << tm_sec ; how can i do that!! :confused:

Member Avatar for Mr_PoP
0
91
Member Avatar for Mr_PoP

[CODE] #include <iostream> #include <fstream> using namespace std; void LOGMSG(string test) { ofstream log; log.open("text.txt"); log << test.c_str(); } int main() { LOGMSG("this is a test"); LOGMSG("this is a test2"); LOGMSG("this is a test3"); } [/CODE] but it's only writes the last line i mean the last time i called …

Member Avatar for MasterGberry
0
493
Member Avatar for MasterGberry

I am getting 2 different compiler errors of the following: AoE2Wide.cpp(1089): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'AoE2Wide::DrsItem' (or there is no acceptable conversion) 1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector(599): could be 'std::vector<_Ty> &std::vector<_Ty>::operator =(std::vector<_Ty> &&)' 1> with 1> [ …

Member Avatar for MasterGberry
0
194
Member Avatar for nomadewolf

Hi, I have this struct: [CODE]typedef struct empresa { char nome_empresa [20]; MORADA morada_empresa; int nif; int telefone; int anocriacao; char cae [20]; ESTAGIARIO estagiarios [MAX_EST]; int num_est; } EMPRESA;[/CODE] And an array of this struct: [CODE]EMPRESA empresas [MAX_EMP];[/CODE] My problem is that when i try to, manually assign values …

Member Avatar for osirisgothra
0
146
Member Avatar for alonewolf23

Is it possible to print the .00 in the Part_Price[] so it would say 11.00 instead of 11. [CODE]#include <cstdio> #include <cstdlib> #include <iostream> using namespace std; double Part_Code[10]={1,2,3,4,5,6,7,8,9,10}; double Part_Number[10]={101,202,303,404,505,606,707,808,909,1010}; double Part_Price[10]={5.00,4.00,6.00,8.00,10.00,11.00,15.00,20.00,3.50,12.50,}; double Number_OnHand[10]={20,15,10,50,13,5,9,7,15,6}; int main(int nNumberofArgs, char* pszArgs[]) { int Pnumb,i; cout << "Enter Part Code '1' thru …

Member Avatar for mrnutty
0
133
Member Avatar for Dorson8009

I've searched all over for an answer to this, including this forum, so sorry if I missed something, anyway, I'd like to get a numerical code from extended characters like ß or ü and so on. I don't use them very much myself, as I'm a native English language user! …

Member Avatar for Dorson8009
0
165
Member Avatar for iamthesgt

The first day of class today we had an (optional) diagnostic programming assignment. The problem is: to take an input file with a sentence in it, and make all letters except the first one lowercase, make the first letter uppercase, and remove any extra spaces and line breaks. After working …

Member Avatar for mrnutty
0
217
Member Avatar for sahil1991

hello, i have a dev c++ compiler and i want to install the allegro on it...... i tried few methods but they didnt work out.... can anyone tell me how to do it,plz?

Member Avatar for Peter_morley
0
73
Member Avatar for TailsTheFox

Hello everyone, I am having a slight problem with my program, and that is that It just doesn't seem to be working! I would like someone to help me fix it, because I can't do It myself. The main problem I am having is adding a string to a string, …

Member Avatar for arkoenig
0
111
Member Avatar for Vv IVIatthew vV

Hello all, header files seemed pretty simple when i first learned about them. until i actually tried to use my own. The program that i am attempting to create should simply add 1 to 24, but it is using a function found in a header file as a test. The …

Member Avatar for Vv IVIatthew vV
0
191
Member Avatar for lulzor

Hello guys. I want to create similar web browser in my application like VB6's web browser control (schw**.dll i think not sure). I just want it able to hold JavaScript, edit HTML elements, view page source, submit forms, ... like I already mentioned VB6 web browser component has... Cheers

Member Avatar for Ancient Dragon
0
36
Member Avatar for n00b3

Hello, I am writing a c++ program for windows using the API. My program needs to be able to get some text from the clipboard, import it to the program's scope as a string, and do work on the string. [what I have tried] [code] cout << GetClipboardData(CF_TEXT) << endl; …

Member Avatar for Panda_007
0
5K
Member Avatar for htowa

Hello I have problem with adding two numbers that are less than 10 and their result is more than 10. [CODE]#include <iostream> #include <sstream> #include <string> using namespace std; typedef class node * node_pointer; class node { public: int num; node *nxt; }; string reverse (string str) { int len …

Member Avatar for htowa
0
178

The End.