51,593 Topics
![]() | |
Hello, Can you help me to install the gtk library in Dev c++. I have installed it in Linux but i dont know how to install it in Windows. Thanks in advance. | |
Hi guys , after finishing my text based game , when i send the executable file to my friend he cannot open it .. he get an error that smth is wrong in configs file .. he also has framework installed | |
how do i get a user input string for file input/upload to work? [CODE] int main() { string P = ""; cout << "Input Directery Example: \" C:\\Users\\mugen\\Desktop\\data.txt \" " << endl; getline(cin, P); ofstream fileOut(P); //does not seem to read string "P" how do i get it to work … | |
Problem Description My pi is an irrational number, i.e. it cannot be written as a fraction. It's approximate value of p is 3:141592653589793. Below are 5 di erent series which can be used to approximate p: 1. P= 4(1-(1/3)+(1/5)-(1/7)+(1/9)-... 2. P= sqrt(12(1- (1/4)+(1/9)-(1/16)+(1/25)-...)) 3. P= sqrt(6 (1+ (1/4)+(1/9)+(1/16)+(1/25)+...)) 4. P= … | |
Hi, Here's my code [code] #include<iostream> #include<fstream> #include<string.h> #include<math.h> #include<stdlib.h> #include<stdio.h> using namespace std; int cIndex(char *x,char **featlist,int len) { int i; for(i=0;i<len;i++) if(strcmp(x,featlist[i])==0) return i; } int main(int argc,char *argv[]) { std::ifstream featFile(argv[1],ios::in); std::ifstream trainFile(argv[2],ios::in); // std::ofstream svmFile(argv[3],ios::out); char line[20000]; char feat[100]; char **featlist; int i=0,len=0,fl=0,j; char* x; int … | |
hi, i am pretty new at using c++. i am trying to read a mathematical expression from a file but i keep getting errors. i am using the cin.get function to read it but it isnt working. can anyone help me please. this is what i have. the file being … | |
hi,i m making a windows forms application and i want to make a treeview which displays input of textbox Under the Parent Node . i have tried searching over the internet,but nothing seems to be working. i have added the parent nodes from the properties tab,but how do i change … | |
I`m trying to to use if statement but something going wrong. statement must be 2 steps IF There is still room in the array and IF there is not an Appointmen on the same Date and Time! Apointment will be accept...... im not getting any error or worning but its … | |
i have created an exe which shows a message but the problem is i want to create another program from which a person can enter his name, choose destination and click create after clicking create a new exe if made in the location he chose which has the name he … | |
Hi, Following code snippet show the maximum number of nodes to be created. I execute this code and show the count : 7874 My problem is that I want to create more node than 7874. I have compiled this code by Turboc version 3.0 on Windows XP. [CODE]#include <stdio.h> #include … | |
[code=cplusplus]#include <iostream> #include <fstream> using namespace std; void PrintError(fstream&, char, bool&); int Conversion(fstream&, char&, bool&); int main() { fstream InFile; char Bit; int Decimal; bool BadBit = false; //Open file to read InFile.open("f:\\Binary.txt",ios::in); //Read the first bit of the number InFile.get(Bit); //continue reading all numbers till the end of file … | |
Hey guys, How would I partially specilize a template in a manner as below? Is that even possible? I have these two functions: [code=cpp] bool node::read(const char *filename) { ifstream f(filename); if (!f.good()) return false; bool success = read(f); f.close(); return success; } bool node::write(const char *filename) { ofstream f(filename); … | |
hi all, i have created a class names members which looks like this.. class mymembers{ int data; float dummy; char* thename; public : mymembers() { cout<<"the value of i is "<<data; data =12; } mymembers(int ic,char* name) { thename = name; data= ic; cout<<"hello this object's data value is "<<data<<endl; … | |
Well, I don't want to do lot of copy-paste in my code, so, I'm just wondering - is it possible to have two different names of one functions(I prefer that function name describe what is used for): ex: [CODE]int do_my_client(int info) { blah blah blah; .... .... return inf; } … | |
Hi there, I am having a problem with the following code: [CODE]#include <iostream> #include <string> #include <fstream> using namespace std; int findRows( string line ); int main() { string line; int rows = findRows( line ); cout << "Number of rows: " << rows << endl; } int findRows( string … | |
Question 1: Write a program that reads repeatedly 3 integers a, b, and c and test if they are Pythagorean triples. Whether or not . Your program should keep reading in triples until all three values entered are zero. When The user enters three zeroes, it should exit without printing … | |
Hello, i'm very new to c++ and i'm trying to create some sql but dont really know how. i need a very simple query in php i would do something like: [CODE] $page = "pagedata"; $sql = "INSERT INTO data SET field = '$page'"; [/CODE] i know i cant do … | |
Hello guys , i created a text based RPG , now how can i save what the player did before he exit? for example , he have killed some monsters , gained exp .. i need to save the exp , his name when he start a new character , … | |
I'm implementing dijkstra's algorithm, and I'm implementing it using a priority queue so that the shortest distance is on top for fast access. The priority queue uses a vector for its operations. Each node has the following properties: int id int dist Node *path Here is the issue: when I … | |
Hello Everybody, Need abit of help in my code: Basically I have two forms, namely form1 for Login and form2 is the actual application. The first issue I had was hiding the form1(login-screen) after a successful login which I was able to do by declaring [code=c++] Hide(); [/code] Now the … | |
Hello everyone, first little explanation about what i want my program to do: i use wget to download a webpage but instead of downloading it into a file i want the webpage sourcecode in a variable so that i can parse it and put it in a database later. Now … | |
I doing this server and client program. The sever has to output to the client. [code] strcpy ( outBuf, " " ); sprintf ( outBuf, "cylinder: %d Sector: %d\n", cylinders, sectors ); if ( write ( client_sockfd, outBuf, strlen ( outBuf ) + 1 ) < 0 ) { perror … | |
Hi! I'm making an inventory managment system, but i need User Authentication, to login users, and controle there Type, like admin, guest or normal users. I want to do it with .CSV files, because the rest of my program is witch CSV files. Does anyone have a sample code, for … | |
ok, I am needing to calculate powers in C++ (ie, 10^6, 10^9, 10^101, etc) the pow function uses double, and after 10^5, returns a number like (8e3245) ... but i need it for larger powers ... now, is there a function I can do that will break it down somehow? … | |
Does anyone know how gmp works? It's supposedly installed but I don't know how to use the functions. I try following this site http://es-sun2.fernuni-hagen.de/cgi-bin/info2html?(gmp)Top but it doesn't compile when I try using the functions. What I'm trying to do is factor a large number. Is there an mpz function for … | |
Hi, I dont know much about programming, however I have a c++ program(i didnt write it) that I need to use it to do some experiments. When I compile the program I get this errror. [code] dynn.cpp: In function ‘void make_near()’: dynn.cpp:374: error: name lookup of ‘j’ changed for new … | |
Hello, I recently bought "An Introduction to programming with C++ (4th edition )" by Diane Zak, and i really liked the way C++ was introduced to me with concept lessons and all. When I have finished this book, and hence made my mark with basic C++, i think i shall … | |
Hey, I'm not a programmer at all, but I'm hoping someone could help me solve a problem. I've looked all over Google, Ruby forums, and C/C++ forums but havn't found my answer. I'm trying to generate all possible permutations for 5 digits (1,2,3,4,5), up to and including 6 digits long, … | |
i'm trying to make this program which simulates a printing queue, a very basic level program that implements priority queues. i'm stuck in the last function, i.e. the simulate function, there's that while(temp!=NULL){...} loop in simulate function which works perfect the first time but turns into an infinite loop the … | |
Hi, I have a question with ofstream, is there anyway to ask the user for a file name, then create the file, and write to it? Like: [CODE] string file; cout << "Enter filename:"; getline(cin, file); ofstream ofile; ofile.open(file); ofile << (stuff....); ofile.close; [/CODE] ...except that doesn't work properly.:S Thanks … | |
i have some code to kill a process [code=cplusplus] TerminateProcess((HANDLE)sinfo->process->Handle, 0); [/code] what happens is so the process freezes and starts eating up the processor... so i i try to terminate it, but it only goes white and that box pops up that says "bla bla bla" stopped working... is … | |
I've gotten about 90% of this program done, but I can't seem to figure out how to do one last operation in it that is needed. What I'm having a hard time figuring out, is how to make a total for each person in the file? I'm sure it's deceptively … | |
I'm looking for some help resolving the following warning... warning: format ‘%c’ expects type ‘char*’, but argument 6 has type ‘char (*)[128]’ [code] char data [ BLOCK_SIZE ]; sscanf ( inBuf, "%c %c %c %c", &mode, &c, &s, &data ); [/code] essentially what happens is inBuf is a 'string' and … | |
1 write aprogram toread student's name examination number ,score for six subjects plus their average score using type one of c++ please i need this 30 minutes 2 using c++ write aprogram compute the number of students in a room (classes) | |
Hi all, I have to make a graphics project about drawing a circle like: 1/Draw the circle on the screen with yellow pen color and dark blue background. (Note: yellow color: 0xFFFF00, dark blue color: 0x191970). 2/ Rotate the circle counterclockwise around the center I with the speed 10 degree … | |
I am creating a program to count the vowels and have run into a problem concerning my loop. }#include <iostream> #include <cmath> #include <iomanip> using namespace std; bool isVowel(int num); int main() { bool tof = false; //initializes tof bool to false int vowels = 0; char x; cout << … | |
[code]int c, s; sscanf ( inBuf, " %d %d", &c, &s ); [/code] I wanna check if c and s are actually int. suppose if you enter a letter rather than a number, how do i check? drjay | |
Hi, i wish to know the difference between the following two code? ifstream fin(fname,ios::in); vector<string> temp; while(getline(fin, line) { temp.push_back(line); } and while(!fin.eof()) { getline(fin,line); temp.push_back(line); } thanks | |
ok so i wanted to make a number randomiser like so: [CODE]#include <iostream> #include <windows.h> using namespace std; int main() { srand((unsigned)time(0)); int random_integer; for(int index=0; index<20; index++){ random_integer = (rand()%60)+1; MessageBox(NULL, "Random Number: ", "Bingo",MB_OK | MB_ICONINFORMATION); Sleep(2000); } return 0; } I want to put the randon_integer result … | |
I have two files and I would like to call addition function from functions.cpp in main.cpp. But I get error: [COLOR="Red"]In function `int main()': error: `addition' has both `extern' and initializer error: initializer expression list treated as compound expression warning: left-hand operand of comma has no effect error: `addition' cannot … | |
[code] /* Is it possible that someone could give me a pseudo code for what I am suppose to do, step by step. The professor gave us 3 codes and also a infile in which I saved it as InkList.txt. She wants us to create a program as she stated … | |
Hey, I'm writing a function that searches for an id in an array of a structure, for some reason it returns -1 everytime, so I was just hoping another set of eyes could help me clarify this. [code=cplusplus] int searchAr(student studentar [], int size, int searchid) { int i; for(i … | |
If i have an array like that int x[100]={1,0,3}; so only i have 3 elements and the rest of the array is zero, how can i count the number of elements in a larger one .. | |
I am new to C++ and am trying to do this [CODE]void rolodex::createCard(){ char* userData = "\0"; cout << "\n\nEnter first Name - "; cin >> userData; currentCard.setFirstName(userData); cout << currentCard.getFirstName(); count++; } [/CODE] when I try to execute it gives me an unhandled exception, access violation error What am … | |
I'm new to C++, and I have a function, [inlinecode]char* parse( char* buf, char* find_this )[/inlinecode] which finds an instance of [inlinecode]find_this[/inlinecode] inside of [inlinecode]buf[/inlinecode]. Once it finds that, it looks ahead in the [inlinecode]buf[/inlinecode] text, (which is actually JSON formatted) finds the value in the text, and it returns … | |
Hi everybody! I would really appreciate any help on this. I have googled for an hour without a result. Few different hints but no one understandable enough. I want to use Latvian or UTF-8(Unicode) characters in Dev-C++ to input and output text from console. Can anybody give me a hint … | |
Hi, I'm trying to write a code for Caesar Cipher, I don't seem to be able to get it right, I'm having no compiling errors, but there're some real logical errors, the encryption function is working fine, but I'm having troubles with the decryption. I'd love it if someone helps … | |
Hi, I'm implementing kd trees and have pseudo code for most of the functions but the delete operation.Its quite complicated and I have no idea how to implement it.Any help is appreciated | |
In the following code, how RAND_MAX works and how the poisson distribution value generated??? what will be the value of RAND_MAX in following code?? long poisson(double lambda) { double u = double(rand()) / RAND_MAX; long k = 0; double currentprob; while (u >= (currentprob = pow(lambda,k) * exp(-lambda) / factorial(k))) … | |
Hello. I am trying to make a C# application login on my ASP.NET page. I am using a login control to check the login. login.aspx [code=ASP.NET] <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="TourPortal_WebUpload.login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> … |
The End.