49,766 Topics

Member Avatar for
Member Avatar for mrmodest34

I have written this code to variably test Prim's algorithm and I am timing it using clock(). For some reason it always returns 0 as its running time. I have other code that I have used this exact implementation in and they are returning the currect running times. The code …

Member Avatar for meta.quota
0
507
Member Avatar for Ahtsham
Member Avatar for richieking
0
277
Member Avatar for muhammadnasiri

in my program, in insert function: void apple :: insert(string s, int a) { node *ptr; ptr = new node; strcpy(ptr->name, s); ptr->price = a; ptr->next=head; head=ptr; } this is acctually i want to do strcpy(ptr->name, s); but error is: cannot convert std::string {aka std::basic_string<char>} to char* for argument 1 …

Member Avatar for deceptikon
0
298
Member Avatar for kirtikesh

i want to use a bitmap file from my computer in c++. i just dont know the code. can anyone help????

Member Avatar for meta.quota
0
203
Member Avatar for dougy83

Hi all, Does anyone know how to quickly (i.e. O(log n) time) insert items into a sorted list? I'd prefer an existing working function if available; I didn't see any appropriate ones in boost or stl. Some background: I'd like to keep a constant sized sorted list, and insert items …

Member Avatar for dougy83
0
13K
Member Avatar for Chrisadams

OS:windows 8,compiler:g++,mysql version:5.6 //bookshop.cpp #include <my_global.h> int main() { return 0; } //bookshop.cpp //Makefile CC = g++ LIBS = -L"C:\Program Files\MySQL\MySQL Server 5.6\lib\" -lmysqlclient INCLUDES = -I"C:\Program Files\MySQL\MySQL Server 5.6\include" all:bookshop bookshop: bookshop.cpp $(CC) -fpermissive -o bookshop $(INCLUDES) bookshop.cpp $(LIBS) //Makefile error: In file included from C:\Program Files\MySQL\MySQL Server 5.6\include/my_global.h:68:0, …

Member Avatar for Chrisadams
0
1K
Member Avatar for moudy.mak

I need the way for allow users input text by writing , while users input text they see what's they input when user press enter jump for next line and when user end press on button to finish ?

Member Avatar for meta.quota
0
2K
Member Avatar for Junior_1

hello! i want to add 3rd party EXE into form. but problem is i think it almost impossible to change without using dll injection . before i was try several method but all failed. actually i was try with vb or vb.net because i almost don't know c++ but vb …

Member Avatar for meta.quota
0
320
Member Avatar for Builder_1

my problem is that how can we intialize a string using cin in output console like this. eg. My class is very good through cin...as the spaces put the null character so only first alphabet is initialized....kindly someone give me solution..

Member Avatar for Ancient Dragon
0
702
Member Avatar for yogesh_6

#include<iostream> using namespace std; int main() { int n;int*p; int i=0,j=0,temp=0; cin>>n; p=new int[n]; for(int i=0;i<n;i++) { cin>>p[i]; } for(j=0;j<n;j++) { for (i=j;i<n;i++) { if(p[i]>p[i+1]) { temp=p[i]; p[i]=p[i+1]; p[i+1]=temp; } } } for(i=0;i<n;i++) cout<<p[i]<<endl; return 0; }

Member Avatar for Moschops
0
150
Member Avatar for khader(ldo)
Member Avatar for davorka.tonkovic_1

hi. i'm trying to convert program from c++ to pyhton, but i don't have any experience with python. can someone help me? #include <stdio.h> #include <conio.h> main() { float uplata,i; do { printf("Unesite pocetnu uplatu:"); scanf("%f", &uplata); if(uplata>3000) { printf("Pocetna uplata ne smije biti veca od 3000 kuna."); } } …

Member Avatar for Ancient Dragon
0
676
Member Avatar for Lee_2

Hi basically I am creating a zombie survival game using Irrlicht. I have a base class Survival.cpp with my game loop in a method called `Survival::Run()` I am trying to call a `Shoot()` method from within the game loop from another class within Bullet.cpp I have included the `Shoot()` method …

Member Avatar for L7Sqr
0
304
Member Avatar for CreatorZeus

okay i have a file with data orgainzed like this in a dat file to be read: apple.0.0.end. and i want it to be read by char until it sees "." then print that, then read again repeated until the end of the line. so i can show the data …

Member Avatar for deceptikon
0
259
Member Avatar for hemanshurpatel

Hi friends, I want to implement code which can take input from some other application. Like say for example ls | less Here, less is the application/utility which takes input from ls via pipe. I want to implement the same in C. I Did following things 1. Created PIPES using …

Member Avatar for Tumlee
0
710
Member Avatar for Kumi_1

` Inline Code Example Here #include <iostream> #include <stdio.h> #include <string.h> #include <stdlib.h> struct contact_detail { int id; char user_name[15]; char email_address[15]; int phone_number[10]; char address[10]; }; struct meeting/appointment { int date_of_meeting/appointment[7]; int time_of_meeting/appointment[4]; char location[15]; }; struct new_user; struct meeting; void add_new_record(void); void binary(void); void delete_record(void); void edit_record(void); void …

Member Avatar for Ancient Dragon
-1
1K
Member Avatar for ArashVenus

I've tried lots of times to get this to work but , no luck . the problem is this program shows white screen , and It doesn't display the polygon . Here's the code , take a look : /*Headers*/ #include <GL/glut.h> /*End of headers*/ /* Check Compiler*/ #ifdef __FLAT__ …

Member Avatar for ArashVenus
0
8K
Member Avatar for MisterGlow

I am student just finished an introductory class on C++. Can any one help me build a GUI for my programs? Maybe a template? Example? Any and all help would be greatly appreciated. Thanks.

Member Avatar for mrnutty
0
181
Member Avatar for Aisha_1

A queue is a restricted data structure that allows only the following operations: a.Enqueue" an item at the end" of the queue. b.Dequeue" an item from the beginning" of the queue. These should correlate with your intuitive notion of a queue (line) in the physical world. In queues the first …

Member Avatar for nahi
0
247
Member Avatar for samer.aboufakher.3

// my problem is in the playerscore and computerscore always gives me 0 or 1 // i cant know who finally won plz i need ur help //at the end of the program it should gives me the score of computer and the user out of 5 of the total …

Member Avatar for samer.aboufakher.3
0
187
Member Avatar for haider885

Helloo... I am making a simple notepad program. I don't know how to move cursor using ASCII Table. I am using Two way doubly Linked List method to insert characters. And file handling to save on file. I don't know how to move cursor on up, down, right and left. …

Member Avatar for Ancient Dragon
0
671
Member Avatar for salah_saleh

Hi, I have followed the tutorial in this link: http://www.cs.ucla.edu/~zhu/tutorial/Using_MS-MPI.pdf to use MPI on my local windows machine with vs. The simple Hello wold work as expected, I have 2 processors and I get the expected result. The problem is when I try a very simple send receive program I …

Member Avatar for salah_saleh
0
188
Member Avatar for haider885

Can Any body do it???? These are Some Info..... Create a notepad that allows the user to write text on the console. For this purpose, the user should be able to control and track the movement of the cursor. The user can access, add and delete any part of the …

Member Avatar for Ancient Dragon
0
766
Member Avatar for princessophia

I am supposed to write a program that displays the first 10 lines of a file. I have a file named "characters.txt" in the same folder that my .cpp is saved in, but when I try to compile the program, it says the file cannot be found. Here is my …

Member Avatar for ling_tj
0
328
Member Avatar for mixelplik

I'm trying to get a better understanding of ifstream, and was playing with it using the program below. It's purpose was to grab the first and last entries in the file, instead I get some perplexing output leading me to realize I've very little clue as to how streams really …

Member Avatar for mixelplik
0
1K
Member Avatar for Bilal93

int rad; int rad; float PI = 3.14 ,area,ci; printf("\n Enter radius of a circle:"); scanf("%d",&rad); area = PI*rad*rad; printf("\narea of a circle is %f",area); ci = 2*PI*rad; printf("\ncircomeference of a circle is %f",ci);

Member Avatar for vegaseat
-1
195
Member Avatar for mixelplik

I see a lot of people list code using this "::" as in: #include <iostream> int main() { std::cout << "Blah, blah, blah"; return 0; } and others use "using" #include <iostream> using namespace std; int main() { cout << "Blah, blah, blah"; return 0; } Is there a downside …

Member Avatar for mixelplik
0
279
Member Avatar for MacErich

Dear all Can anyone explain to me how a (local) counter can be modified in a loop without being touched in the code? ... and how I am best to debug this? Thanks Erich void test(double *x, int l, int N, int K, double *p, Comp * y) { int …

Member Avatar for MacErich
0
198
Member Avatar for Annettest

Hello all: I have written a function that gets data (numbers) from a text file. My function works by taking a line from the text file, discarding unnecessary symbols, and putting the numbers into a vector. Here's a snippet: // Get data from text file. Values then put into one …

Member Avatar for haider885
0
395
Member Avatar for girmanigatu
Member Avatar for Slavi
0
139

The End.