49,761 Topics

Member Avatar for
Member Avatar for norcominc

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 …

Member Avatar for tux4life
0
206
Member Avatar for BoneXXX

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 …

Member Avatar for BoneXXX
0
352
Member Avatar for pspwxp fan

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 …

Member Avatar for jbennet
0
105
Member Avatar for claytonl

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, …

Member Avatar for nexocentric
0
159
Member Avatar for threat

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 …

Member Avatar for nexocentric
0
159
Member Avatar for Dannyo329

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 …

Member Avatar for Dannyo329
0
154
Member Avatar for nschessnerd

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 …

Member Avatar for nschessnerd
0
137
Member Avatar for orcsoul

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 …

Member Avatar for orcsoul
0
120
Member Avatar for drjay1627

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 …

Member Avatar for skatamatic
0
166
Member Avatar for luutu_amir

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)

Member Avatar for skatamatic
0
135
Member Avatar for thebluestar

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 …

Member Avatar for skatamatic
0
151
Member Avatar for astonomer

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 << …

Member Avatar for skatamatic
0
127
Member Avatar for drjay1627

[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

Member Avatar for drjay1627
0
72
Member Avatar for guest7

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

Member Avatar for ArkM
0
112
Member Avatar for slim2hott

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 …

Member Avatar for slim2hott
0
153
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
2K
Member Avatar for bmcutler011

[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 …

Member Avatar for tux4life
0
83
Member Avatar for lancevo3

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 …

Member Avatar for lancevo3
0
172
Member Avatar for super.mina

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 ..

Member Avatar for tux4life
0
8K
Member Avatar for Ani2084

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 …

Member Avatar for siddhant3s
0
65
Member Avatar for crh0872

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 …

Member Avatar for crh0872
0
147
Member Avatar for Shmera

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 …

Member Avatar for Ancient Dragon
0
359
Member Avatar for Gewalop

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 …

Member Avatar for siddhant3s
0
152
Member Avatar for AutoC

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

Member Avatar for ArkM
0
93
Member Avatar for nirav bhatt

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))) …

Member Avatar for ArkM
0
88
Member Avatar for Clockowl

Hey guys, I have a class with a friend function and a member function with the same name. Calling the friend function from the member function gives me an error: it looks for <classname>::<function> while the friend function is of course simply <function>. In this case, MinGW GCC says: [code] …

Member Avatar for Clockowl
0
176
Member Avatar for vddmanikanta

Hai everyone I need a clarification on the following issue Why does C++ compiler doesn't allow, to initialize static member function inside a class And please do tell me about what is meant by initializing a function (member function) Please help me in getting it clear thank you Have a …

Member Avatar for vddmanikanta
0
124
Member Avatar for RaghuBV

Hi folks, Can I insert multiple entries into a single bucket in a hashtable. It ll look somethin like this Key Hash value Bucket Browser B Browser->Search Brawn->F1 Car Bread->Wheat dish . . Cat C Cat->Animal C++->Language Please help me

Member Avatar for RaghuBV
0
61
Member Avatar for jct3u

I have to write a program that does this Write a complete C++ program to solve the following problem. PROGRAM DESCRIPTION: An unknown number of integers, but no more than 25, are to be read from the file exam.dat. (Yes, this means you have to open that file.) Calculate and …

Member Avatar for DemonGal711
0
221
Member Avatar for ScienceNerd

I’m trying to code a program that displays letters in alphabetical order. It complies but the problem is that when it compiles, the letters [characters] don’t show up. The only thing the text file has is some random letters {A E C B D O). [code=cplusplus] int count(char input_filename[]); void …

Member Avatar for WaltP
0
123

The End.