51,593 Topics

Member Avatar for
Member Avatar for loumbut

Hi, a friend recommended the following winsock code to me. [CODE] #include <stdio.h> #include <winsock2.h> void abc(char *p) { char *ptr; p[1000] = 0; ptr = strchr(p,(int) "\r\n\r\n"); if(ptr) ptr[4] =0; printf("%s", p); } int main(void) { WSADATA ws; int d; char aa[1001]; struct sockaddr_in a; SOCKET s; int ii; …

Member Avatar for Fortran IV
0
1K
Member Avatar for NickPatton

I'm working on an assignment where I have to write my own raisePower function to take a base and a power and compute the product. The assignment states that the function needs to return a long but all input/output values should be ints. The code compiles and runs but does …

Member Avatar for Caligulaminus
0
213
Member Avatar for alastair1008

I'm just starting out in C++ and want to use TextOut to print a character that is generated at runtime based on keyboard input but am having trouble converting TCHAR to LPCWSTR so that it can be used in the TextOut method. my code is [CODE] LRESULT CALLBACK WndProc(HWND hWnd, …

Member Avatar for Ancient Dragon
0
272
Member Avatar for bennetk2

I can't figure out what this error is saying. Error: C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp||In function 'bool operator==(const statistic&, const statistic&)':| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|225|error: passing 'const statistic' as 'this' argument of 'float statistic::sum()' discards qualifiers| C:\Users\Kyle\School\CS 372\Statistician\Statistician.cpp|226|error: passing 'const statistic' as …

Member Avatar for gusano79
0
338
Member Avatar for suneye

Hello, I need someone to give me ideas about a project to start developing it. I am an intermediate programmer and I want to develop my skills .thanks in advance guys

Member Avatar for suneye
0
81
Member Avatar for skannigan

As Part of an assignment one of the requirments is to convert a date into month format. that is the user must enter start month and year of employment and end month and year of employment for example 4 1980 till 7 2009 (mmyyy) these two dates must be coverted …

Member Avatar for skannigan
0
164
Member Avatar for arold10

I am working on an assignment that I currently have. I am using cin.getline to input the title of a book. The problem is every time I run it here is how it shows up in the command prompt [B]Title: Price: $_[/B] Why is it doing this? cin.getline seems to …

Member Avatar for deceptikon
0
123
Member Avatar for mrnutty

Check out the [URL="http://en.wikipedia.org/wiki/Boggle"]wiki[/URL] for boggle. You job is to create a program that generates all possible words that can be constructed given the boggle board and a dictionary. A word has to be of length three or greater and the word has to exist in the dictionary. For example …

Member Avatar for mrnutty
0
267
Member Avatar for miturian

(I hope this is not already covered in another post, a quick search didn't turn up anything in the archive) So, I have recently made a lot of changes to a program, and want to quantify what those changes have done to the speed. Let us call the old version …

0
99
Member Avatar for rajnagthi123

Hi, The key suppress event is working fine for english character for a string (blocked string). But for korean characters, if i tried to edit the blocked character, the character is not blocking it is simply typing. i tried by key supress event and handled event it is not working. …

0
39
Member Avatar for ruval002

i need help with my makefile. This is my first time dealing with one.I have ,ll.C and main.C, and one header file called ll.h main.C has the header file ll.h included and some other libraries ll.C has the header file also. and when i compile it i get this error: …

Member Avatar for caut_baia
0
170
Member Avatar for sohaib paracha

#include<iostream.h> #include<iostream> #include<iomanip.h> #include<windows.h> void main() { int a,b,c,h,m,s,l=44; cout<<setw(l); cout<<"DIGITAL CLOCK"<<endl; cout<<"\n"; cout<<"Enter time in hours = "; cin>>a; cout<<"Enter time in minutes= "; cin>>b; cout<<"Enter time in seconds= "; cin>>c; start: for(h=a;h<24;h++) { for(m=b;m<60;m++) { for(s=c;s<60;s++) { Sleep(1000); system("CLS"); cout<<h<<":"<<m<<":"<<s<<endl; } c=0; } b=0; } a=0; goto start; …

Member Avatar for Eagletalon
0
188
Member Avatar for VBNick

I just finished up writing a class to encapsulate a pointer-to-pointer that provides auto-release functionality like shared_ptr<T>. I'm curious though, does something like this already exists, in the standard library, boost, ect? I know the idea exists, because in the Unity Engine, when you call Destroy(gameObject), any and all references …

Member Avatar for VBNick
0
146
Member Avatar for Whoaa512

search and didnt find anything that was close to this. so my assignment is to simulate a simple authentication, where the user enters their original pin or password(numbers only). it must use arrays to assign the password a pseudo-random assignment of 1-3 for digits 0-9. after that the program clears …

Member Avatar for Whoaa512
0
346
Member Avatar for Reclaimer0418

I've been staring at this code for about 3 hours, changing things back and forth and making myself feel really stupid....please, anyone, help me. [CODE]#include <iostream> #include <cstdio> #include <string> using namespace std; int main() { //declare variables int gas, time, distance; // could have used \n all in one …

Member Avatar for MandrewP
0
776
Member Avatar for inspire_all

i am a bit confused.i am feeling that one should be expert at data structures rather than language.i am learning c++ this semester,learning oop and data structures.[COLOR="Red"]is data structures more important than language?[/COLOR]what can get u into a good company?

Member Avatar for WaltP
0
128
Member Avatar for Diamond3x

What is "std" and "::" .Like for example, std::cout. Now i know what is cout for but what is std and what are these "::" for?

Member Avatar for neartoyou
0
256
Member Avatar for juce

I need a code which will print union of two strings. for example string1="1,2,3" string2="3,4,5" and print the result string3: 1,2,3,4,5 Could someone help me how to solve this?

Member Avatar for mazzica1
0
1K
Member Avatar for mjacqu4

Hey, I'm a bit rusty at c++ and I'm sure that I'm just missing something stupid, but I have a class that takes in an ifstream object in its constructor. In my main function I create an ifstream, open a file, then pass the ifstream object by reference into the …

Member Avatar for mjacqu4
0
845
Member Avatar for juss2022

Hello everybody. I've a question. I tried to change font size of textBox named "textBox1" Here is the function of the NumericUpDown: [CODE]private: System::Void numericUpDown2_ValueChanged(System::Object^ sender, System::EventArgs^ e) { String^ Num2 = this->numericUpDown2->Text; this->textBox1->Font->Size = Num2; };[/CODE] Errors that occur: [CODE] error C2039: 'set' : is not a member of …

Member Avatar for Ancient Dragon
0
457
Member Avatar for mz_rigel

Hi, I'm trying to write a program that converts a base x to a base y. It says that we are suppose to use two functions to do so: one that converts base x to base 10 and one that converts base 10 to base y but I don't understand …

Member Avatar for WaltP
0
1K
Member Avatar for juce

I had code in C++ which works really. I need to find alternative solution for this kind of solution... Could some help me how to change the code ... [CODE]#include <string> #include <iostream> using namespace std; int main(){ string s1="abv"; //Set up string 1 string s2="vxz"; //Set up string 2 …

Member Avatar for histrungalot
0
128
Member Avatar for Reeseoo

Hi.. I have an image of what my code is drawing attached, although the code is meant to draw multiple trapeziums and now the extra line lol. I was wondering if anyone could tell me where i was going wrong. Here's the code.. [CODE]void DrawPolygon(POLYGON *p) { int current_Left, current_Right; …

0
47
Member Avatar for rayden150

I am trying to make a recursive program that prints out the numbers from 1-100 without using any iterations such as loops, but every-time it just keeps printing out 5050..? [CODE] #include<stdio.h> #include<stdlib.h> int counter(int num); int sum=0; int main(){ int result, num=100; result = counter(num); printf("%d", result); system("PAUSE"); return …

Member Avatar for siaswar
0
297
Member Avatar for Stein102

I want to start C++, and I already know a fair amount of Java. So I ordered the book Accelerated C++ because I've read that it's a good book. But I was told that It's not a very good first c++ book? The only other c++ book I have access …

Member Avatar for Senovit
0
68
Member Avatar for SoftShock

This code finds the sum & average of the range of numbers that were chosen. I have int begin = 0, end = 0,sum = 0.0, avg = 0; because I get an error saying that all of those need to be initialized, yet by doing so it gives me …

Member Avatar for SoftShock
0
277
Member Avatar for randrum1707

Hi everyone, I'm having issues incorporating something required by my assignment. I am supposed to create a class that has 2 private data members. One should be an array of 10 Database (Database being the name of the other class) objects. The other should be an integer that assigns the …

Member Avatar for randrum1707
0
157
Member Avatar for ruval002

OK so im measuring how much time on some part of my program and it only shows me microseconds. i want to know how can i change this so it would give me seconds something like this "1.0325 second its what i want, not 1035000 microseconds any help will be …

Member Avatar for WaltP
0
111
Member Avatar for nicole10hart

can anyone tell me why my code would output the string designated plus ten or more characters of non sense at the end of it? my code also has a header with #include statements and a main that calls the functions. #include "String.h" //Default constructor String::String() { Text = NULL; …

Member Avatar for zeroliken
0
201
Member Avatar for chuyauchi

I'm having an error on my displayResult function. In the line: [CODE]cout << setw(17) << static_cast<int>(exptRoll[value-1] * intRepeats);[/CODE] I have a C2109 error (subscript requires array or pointer type. Does anyone how to solve this problem? [CODE] void displayResult(const int arraySize, double frequency[], double expected[], int intRepeats, double exptRoll) { …

Member Avatar for histrungalot
0
80
Member Avatar for dwiniers

Hello C++ master out ther i need help guys this exercise is running but the desplay record is in row i want it in column. Thanks in advance! [CODE]#include <iostream> #include <fstream> #include <cstdlib> #include <string> #include <iomanip> using namespace std; char book_no[5]; char title[30]; char author[20]; char publisher[30]; char …

Member Avatar for dwiniers
0
223
Member Avatar for kspecks

So here is something I am writing just to get back into code and I can't find the flaw with it. [CODE] template<typename T> class Array { public: Array(unsigned arraySize): data(0), size(arraySize) { if(size > 0) data = new T[size]; } ~Array() { if(data) delete[] data; } void setValue(unsigned index, …

Member Avatar for VBNick
0
316
Member Avatar for juancarlos2992

Hello guys!, so this is my problem, i'm trying to make a paint-like program in C++ using the WinBGIm libraries (im using Dev-C++), so i need to program a paint brush. Here's what i've managed to code: 1)Create a canvas 2)Create a clickable button (it just returns if it is …

0
107
Member Avatar for randrum1707

Hi everyone, I'm trying to to output an entire character of arrays in my program. I am using a header file with my class, and a source code file for my method definitions. Here are the relevant parts. The method definition for getName() [CODE] char Account::getName() const { return *AccName; …

Member Avatar for WaltP
0
101
Member Avatar for jonnyboy12

Hello people. Does anyone know if it is possible to post a variable to a c++ http tunnel or http connection. In php you can do this when you want to qualify someone on an email varification. People do this in a message so when someone clicks on the link …

Member Avatar for jonnyboy12
0
157
Member Avatar for madhav024

Hi iam facing the problem while compiling the below program, program.h ------------headerfile typedef struct { unsigned char c ; unsigned int i ; unsigned long l ; }data_t ; program.cc ------c++ file # include <iostream> # include <malloc.h> using namespace std ; # include "ptr.h" int main() { data_t data[] …

Member Avatar for therockon7throw
0
267
Member Avatar for KRUX17

Hello, I'm working on a project and the value of num is AdditonalAdultQty + AdultQty (AdditonalAdultQty and AdultQty will be inputted from the user) Then those two values will be stored in the text file. When the program runs again and a different user will input how many tickets he …

Member Avatar for KRUX17
0
170
Member Avatar for Karlwakim

Hi everybody, I need you to answer these questions please. 1- How did you learn c++ : a-books b-videos c-in school or university d- other : 2- How did you feel when learning : a- Bored b- Interested c- other : 3- Was it the first language you learn ? …

Member Avatar for therockon7throw
0
238
Member Avatar for IanKent

Ok. First off, here is the question I am answering Problem 3: Write a program that will read monthly sales into a dynamically allocated array. The program will input the size of the array from the user. It will call a function that will find the yearly sum (the sum …

Member Avatar for therockon7throw
0
348
Member Avatar for ErikaShanks

I have to write a program that should read test scores students received on the first quiz into an array. Assume that up to 30 students could be entered. Input will stop when the sentinel value -1 is entered. Write functions to: 1. Read the original scores into arrays 2. …

Member Avatar for therockon7throw
0
108
Member Avatar for zekstein

I'm tryng to statical link libcurl but im getting some errors... I've done that: [url]http://i39.tinypic.com/25ztkbm.png[/url] [url]http://i43.tinypic.com/2nsugyq.png[/url] [url]http://i40.tinypic.com/a24v4n.png[/url] [url]http://i43.tinypic.com/1fx1lt.png[/url] Why im getting the error in the 4th picture :( ?

Member Avatar for thines01
0
108
Member Avatar for johnyianni

I have here a problem... i have a notepad containing values such as: tom,a1001,1 charles,1002,2 I used getline() and used the delimiter comma to separate them and store it in line variable.. my problem is that how can i store the delimited strings from line variable to any different variables.. …

Member Avatar for chrisjubb
0
223
Member Avatar for chrisjubb

I'm having problems reading or writing files in my C++ program. I'm using Fedora 16 on a USB stick and Eclipse for C/C++ developers. Here's snippet of code from my program. fp is always 0. I've also got other code that is loading files (which always fail). I've tried running …

Member Avatar for chrisjubb
0
233
Member Avatar for C++ programmer

I have designed a dialog in Qt designer and I want to use the name of each child widget for some coding in cpp file. But the names I have given to buttons etc in Qt designer are not working as pointer.More over their names in ui_[I]mydialogname[/I].h are not the …

Member Avatar for C++ programmer
0
192
Member Avatar for C++ programmer

Hi. I made a program and I write this code in order to make the window's size fixed. More over i am using a button to unhide some Groups on main window, But when i compile program, it crashes but when I comment out this line of code the program …

0
104
Member Avatar for jeswill

Please help to those who know how to code or those who are brilliant in c++ to code a beep or a sound in a borland c++ cause i want to learn how to make or to code it; and i don't have a background of coding a beep, please …

Member Avatar for zeroliken
0
843
Member Avatar for ruval002

im having trouble timing my loop, note, this is just part of my main file [CODE] #include <iostream> #include<sys/time.h> struct timeval tv1, tv2; struct timezone tz1,tz2; long totalT; int const times = 500; gettimeofday(&tv1, &tz1); for ( int i = 0; i times; i++) { //do something, } gettimeofday(&tv2, &tz2); …

Member Avatar for WaltP
0
101
Member Avatar for rfrapp

Let me start off by saying that this is homework, and I have most of it completed. However, I am stuck on how to convert decimal to hexadecimal. The assignment is to add two hexadecimal numbers and output the answer. If the length of the answer is greater than 10 …

Member Avatar for rfrapp
0
3K
Member Avatar for Labdabeta

I was just wondering how exit worked? Does it use some lower-level language feature in its implementation? Is it compiler-specific? What is it? (I am talking about the function in stdlib.h btw)

Member Avatar for Labdabeta
0
227
Member Avatar for badboy11

I need helping trying to retrieve data held in a [CODE]std::list<boost::shared_ptr<boost::any>>[/CODE] I am working on a Singleton Controller class with a private [B]std::list[/B]. Client class(es) will be able to [B]Add/Remove/Edit[/B] concrete class objects to be used by the program through this Controller class. The reason for using [B]boost::shared_ptr[/B] is because …

Member Avatar for mrnutty
0
388

The End.