51,593 Topics

Member Avatar for
Member Avatar for rice-_-

hi, I am new to C++. can anyone give me a sample to start with or refer to, on how to create a Windows Management Instrumentation with C++?

Member Avatar for Ancient Dragon
0
38
Member Avatar for Shuichon

If I type g++ main.cpp, I get the error: /tmp/ccalbYhC.o(.text+0x160): In function `main': : undefined reference to `CBigInteger::CBigInteger()' /tmp/ccalbYhC.o(.text+0x389): In function `main': : undefined reference to `CBigInteger::CBigInteger(std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /tmp/ccalbYhC.o(.text+0x43d): In function `main': : undefined reference to `CBigInteger::display()' collect2: ld returned 1 exit status I …

Member Avatar for Ancient Dragon
0
83
Member Avatar for sixstorm1

Hi everyone, I am trying to print content from a Win32 richedit control, but it doesn't work. The text wraps to the half width of the page, and after printing, the text in the richedit is also messed up (word wrap to the half width of the box). I use …

0
152
Member Avatar for kernel>panic

Hi I am just wondering if it would be possible to add compression to this encryption program I have? It will compress the file before it encrypts it for faster encryption time. Thanks for your help.

Member Avatar for DdoubleD
0
226
Member Avatar for goody11

Hey, I was working on a program in windows API where there are multiple edit boxes and there are push buttons. If a pushbutton is clicked, I want the program to find the edit box that the cursor is in and add the character to that edit box. Now I …

Member Avatar for Frederick2
0
129
Member Avatar for Rastafari

[B][U]An overview of what my program does[/U][/B] I'm given a main.cpp file with some function prototypes that I have to define in a separate .cpp to manipulate an image file ( basically a 15 x 15 matrix of 1's and 0's) [B][U]The result of your current code[/U][/B] I dont know …

Member Avatar for VernonDozier
0
116
Member Avatar for ItecKid

Hello, I am writing a C++ program to find the largest such number such that the square root of that number is less than or equal to a fixed number, set by me, like this: [code=c++] #include <stdio.h> #include <math.h> int main (void) { long fixed, param, result; result = …

Member Avatar for ItecKid
0
126
Member Avatar for roberto usu

I have a structure containing [ICODE]struct XboxFriends { char gamertag[SIZE]; char name[SIZE]; char country[SIZE]; char city[SIZE]; char favoriteGames[SIZE]; int age; };[/ICODE] this code is supposed to keep track of my xbox friends. I also have written a function [ICODE]void searchFriends(vector<XboxFriends> &friends) { string gameName; cout << "--- Favorite Game Search …

Member Avatar for vmanes
0
100
Member Avatar for asphp

I'm making a tick tack toe game for a programming class and i*m stuck with some problems. Problem 1: rand sometimes returns a value over the max value. Max is 9 and it can return up to 1000000 on some occasions. Problem 2: The Win function only works in player …

Member Avatar for asphp
0
125
Member Avatar for wheel

Hello! I'm wondering how to go about packing data from an std::vector<unsigned long> into valid unicode (UTF-8) characters. So far, I've tried writing the unsigned long data directly to a text file, but that usually results in invalid characters. (I don't actually need to store the data in unsigned long …

Member Avatar for wheel
0
187
Member Avatar for ridd

Hi I have some code that is supposed to take an array of booleans and for each `(int minBits = 10)` bits turn the binary number into decimal. The algorithm is working in part, but the bit at `binArr[64]` where when is somehow changing in between when I print the …

0
48
Member Avatar for Miganders

so, iwe been messíng arround with C++ for about 4 days now and here is my first real print all squarenumbers (it will break at a point) : [code]#include <iostream> #include <windows.h> //---------------------------- using namespace std; //---------------------------- int main () { string numbers="1"; bool on = true; do { cout …

Member Avatar for Miganders
0
171
Member Avatar for sixstorm1

Hi everyone, I have a modal dialog box which is called by the main thread. This dialog has no parent (appears at center screen, overlapped, and shown in taskbar). When the user clicks "Save" in the dialog, the dialog procedure receives the command and displays a save file dialog (GetSaveFileName). …

Member Avatar for sixstorm1
1
246
Member Avatar for Miganders

[code] #include <iostream> #include <windows.h> //---------------------------- using namespace std; //---------------------------- int main () { long int numbers=1; bool on = true; while (on==true) do { cout << numbers*4; numbers = numbers+1; Sleep(500); } }//--breaks here [/code] how come the loop not work?

Member Avatar for Miganders
0
109
Member Avatar for networkmancer

Now im getting Declaration Syntax Error on line 155. Please help need urgent . [code] #include <stdio.h> #include <conio.h> #include<process.h> #include<dos.h> void graph(); void foo(){ int a,b; clrscr(); gotoxy(27,12);textcolor(12);cprintf(" "); gotoxy(40,14);textcolor(12);cprintf(" "); gotoxy(29,16);textcolor(12);cprintf(" "); for(a=1;a<=72;a++){ gotoxy(5+a,2);printf("Í"); gotoxy(5+a,23);printf("Í"); } for(b=1;b<=20;b++){ gotoxy(5,2+b);printf("º"); gotoxy(78,2+b);printf("º"); } for(int s=1; s<=3;s++){ gotoxy(41,2+s);printf("º"); } for(int o=1;o<=72;o++){ gotoxy(5+o,5);printf("Í"); …

Member Avatar for Ancient Dragon
0
242
Member Avatar for jBat

Hi, I'm just starting to practice with c++ and I'd like to know if there is a good way to handle the errors/exception. I write this program to check the modification time of a file. Thanks [CODE]int filewatcher::watch() { struct stat filestatus; stat(this->_filename, &filestatus); if((filestatus.st_mode & S_IFMT) == S_IFREG) { …

Member Avatar for Nick Evan
0
152
Member Avatar for touqra

Hi, I don't understand why I failed to insert vectors as an input of a function. I wrote : void fun( std::vector<double> do, int &count ){ ... } but it doesn't compile...

Member Avatar for Narue
0
119
Member Avatar for networkmancer

I need to put this one in my case 5 [code]#include<stdio.h> #include<conio.h> #include<process.h> float rate,day,gp,netpay,totald,sss,med,love;int age; float basic,cola,tax;char employee[20],addr[30],sex[10],bday[8]; void main(){ clrscr(); char choice; gotoxy(20,2);textcolor(4);cprintf("Payroll System"); gotoxy(20,4);textcolor(5);cprintf("Select Choices:"); gotoxy(18,6);textcolor(7);cprintf("[1] Add Customer Info"); gotoxy(18,7);textcolor(7);cprintf("[2] Compute Payroll"); gotoxy(18,8);textcolor(7);cprintf("[3] Display Information"); gotoxy(18,9);textcolor(7);cprintf("[4] Exit"); gotoxy(18,10);textcolor(7);cprintf("Enter Choice:"); scanf("%d",&choice); switch (choice){ case 1:printf("Employee Information\n\n"); printf("Enter Employee …

Member Avatar for Ancient Dragon
0
295
Member Avatar for basketball4567

Hi guys, I know that there might already be a tread about reading from file but this has a certain hurdle to jump... I have to read in a 1000 word document into something that will make a list of unique words and how many times they appear. Thats not …

Member Avatar for jencas
0
118
Member Avatar for rahul.agrawal

Hi All.. I want to generate a dialog bar or panel inside a window, for that i have seen a sample code somewhere (implemented on VC++ 6.0).. Now i am trying to use that code in visual studio 2008 but an assertion failed error is being occured..while i am using …

0
94
Member Avatar for Se7Olutionyg

[CODE]#include <iostream> using namespace std; class BigNum { private : int biggest; void determineBiggest ( int num) { if (num > biggest) biggest = num ; } public : BigNum () { biggest = 0 ; bool examineNum(int); int getBiggest() { return biggest; } }; bool BigNum::examineNum(int n) { bool …

Member Avatar for vmanes
0
145
Member Avatar for Der_sed

I know that an array matrix would have been better but Im taking a freshman course so coulnt use it. 1- Tic tac toe grid is defined from locations 1 to 9 2- For loop executes 9 times for 9 turns 3- A functions takes all 9 locations as argument …

Member Avatar for DdoubleD
0
145
Member Avatar for kyosuke0

Iv always had trouble with templates and I always get the same error message "Error: Templates can only declare classes or functions." program is a template linked list class and I'm using the sun studio 12 C++ compiler linkedList.h file: [CODE]#include "nodeType.h" using namespace std; template <class Storeable> class LinkedList …

Member Avatar for DdoubleD
0
268
Member Avatar for atch

Hi, I know that this topic was discussed previously but those previous threads didn't answer to my question which is: How to change color of this text: [code=c++] cout << "Some text" << endl; [/code] when I'm outside of main, i.e. in file with my class and in one of …

Member Avatar for atch
0
280
Member Avatar for rena0514

I have a program where i have to use partial array intialization to read data from a file and place it into an array...there is no example of this in my class book and i'm confused!

Member Avatar for DdoubleD
0
114
Member Avatar for Miganders
Member Avatar for Miganders
0
260
Member Avatar for KIEX

a program that parks in C++,takes the detail of passengers,driver,the car store in the link list class a pass,class acar,class aparkinglot

Member Avatar for Salem
0
113
Member Avatar for AbsoluteCPP

We have seen websites using Flash, very cool Menus, slides and much more. How to do this in C++. I am making a Contact Book. I want to create eye chating cool look GUI for it's front end. I have made a class named ContactManager this class get contact information …

Member Avatar for Ancient Dragon
1
158
Member Avatar for robtech

Anyone got any pointers on the interpretation of REG_BINARY data such as the ascii strings that are stored as binary values in HKEY_CURRENT_USER "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RecentDocs\\folder"; I have long mastered most of the Win32 Registry functions but never really had the need to delve into the murky depths of binary. I guess …

Member Avatar for robtech
0
255
Member Avatar for prodigyaj

I am trying to find the sum of integers ( (int)(a*i)/b ) where i is from 0 to 10^10. The problem is a/b >=1 and can be a fraction also and a and b are constant If it wasnt a fraction then it was really easy i*(i+1)/2 * a/b Any …

Member Avatar for Sky Diploma
0
116
Member Avatar for bunnyboy

Can someone explain what am I doing wrong? I get "vector subscript out of range" error. Here is the sample ... [CODE=cplusplus] #include <vector> using std::vector; struct CUBE { int number; bool changed; }; int _tmain(int argc, _TCHAR* argv[]) { vector<CUBE *> cube; for (int i = 0; i < …

Member Avatar for bunnyboy
0
4K
Member Avatar for himgar

I had written a program [code] #include <fstream.h> void main() { fstream f; f.open("test.txt",ios::app|ios::in|ios::binary); cout<<f.tellg(); f.close(); } [/code] My file test.txt already contains text : " hello " i.e. 5 characters But when i try this it outputs only 0 but ios::app mode places the pointer at the end of …

Member Avatar for Salem
0
86
Member Avatar for Belthemet

[B]#Off topic[/B] When I was logging in, I have noticed 600,00x members registered on this forum. Congrats on the 600k! ;) Hello. My console game is going pretty well, even though I don’t have much spare time to expand it. I have some ideas I would like to add, but …

Member Avatar for Belthemet
0
261
Member Avatar for gretty

Hello I am making a function that takes in a date (dd/mm/yy) & returns what week number of the year the date occurs on. For eg; If I enter: 01/01/09 then the week number of that year will be 1 If I enter: 04/09/09 then the week number of that …

Member Avatar for gretty
0
2K
Member Avatar for prashantsehgal

hello this is prashant. well i need to find some helping materials online on WTL coz even microsoft site isnt having any sort of documentation in this.also can someone give me few examples in this as to how to create a dialog boxes & few other stuff.thanks in advance.

Member Avatar for Ancient Dragon
0
72
Member Avatar for Epi23

Hey everyone, I'm just now learning c++ and was wondering if there was a way to loop this program so that I don't have to copy and paste it. I got it to work, but I was just curious if there was another way to do it. it just does …

Member Avatar for Epi23
0
103
Member Avatar for gopi17

ok...i'm having trouble changing a value in a array into a character [CODE] void gameon(int **game,int &size,int &x,int &y,int &score1,int &score2) { int i,j,num1,num2; cout<<"Please enter a number from the selected row/column -->"; cin>>num1; for(j=0;j<size;j++) { if(num1==game[x][j]) { cout<<"Number found"<<endl; game[x][j]=='X'; score1=score1+num1; y=j; } } display(game,size,score1,score2); } [/CODE] i can't …

Member Avatar for vmanes
0
117
Member Avatar for iammfa

Hi, i'm using c++ with SDL, SDL image libraries, i trying build a small example, i got this error in linking when i build every project: ------ Build started: Project: 00000, Configuration: Debug Win32 ------ Linking... MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup C:\Users\iammfa\Documents\Visual Studio …

Member Avatar for John A
0
160
Member Avatar for ObanaJunichiro

[code]void inputGrid(string inputI, unsigned __int64 &i,int t) { do { t=1; getline(cin,inputI); i=atol(inputI.c_str()); if(i<=1) { cout<<"Please key in only the number that suitable for the grid."<<endl; t=0; } } while(!t); } [/code] //this is the function i used to solve the problem when i key in char //to an integer...but …

Member Avatar for VernonDozier
0
91
Member Avatar for Shreeravi

I have a situation where I have to scan some FTP Servers every 5 seconds to check for some specific files and download them if they exist. I use a Shell script to do FTP download operation and call it using C++ system call in a separate thread. (I am …

0
92
Member Avatar for thierryjohn

hey guys can u pls help in developing this program...im really very beginner in this...can u pls teach me how to start.. thank you so much...god bless You are required to develop a system to record details of student. This system should be implemented using structure and array. You are …

Member Avatar for Nathan Campos
0
291
Member Avatar for ihatestarch

What would a recursive function (not from a class) that puts some kind of element (like an integer) into a 2D array look like? I noticed a 2D array seems to be a bit different from a regular array in a function. Is the first bracket always empty and the …

Member Avatar for ihatestarch
0
2K
Member Avatar for rom87

How would someone go about creating a new cmd window and position it where ever from a win 32 program whenever .Also be able to get a handle to it to output text to the cmd window aswell.What call is required ? Thanks

Member Avatar for Frederick2
0
200
Member Avatar for deostroll

Well, for all those who do not know me: my name is arun. But this name is all too common in this world. So well for online purposes I have another name - deostroll. How I got that name? It wasn't assingned to me by someone; rather I had come …

0
62
Member Avatar for mrnutty
0
333
Member Avatar for mrnutty

Random number generator under its own namespace. Its a sample program.

0
301
Member Avatar for warbird43

Link List for the beginners of cpp, who want to get the idea about link list before starting OOP. its implemented by struct for best teaching the design standards to beginners.

Member Avatar for warbird43
-1
240
Member Avatar for tux4life

This is how I would write the standard library function [B]strstr[/B] if I had to implement it from scratch.

Member Avatar for tux4life
0
581
Member Avatar for athlon32

Example of how to get a random number in the range of six and return a value based upon it. Please Rate/Comment/Report Bugs

Member Avatar for MosaicFuneral
0
135
Member Avatar for tux4life

This is a portable implementation for converting a character or an integer to its binary text equivalent. It makes use of the [B]CHAR_BIT[/B] constant (which is defined in the header file [B]climits[/B]) to get the number of bits a byte consists of on the implementation where you compile this code …

Member Avatar for MosaicFuneral
0
244

The End.