49,757 Topics
| |
Hey guys! I hope what I'm about to do is not frowned upon :) I just would like some input/critics/heads up on my class definition and implementation I did for my project. I am by no means a trained programmer and I doubt my coding style is very good so … | |
Hello, I am trying to get the return value from the next_number function up to the makefile function. I am getting an error that says next_number does not have a class type. EDIT: the error is "return statement with a value, in function returning 'void'" I don't understand why it … | |
Which one is update software for c++ and c language. Some practice center such as Codechef,, Uva online judge , I submit a right code but they said the code has compiling error such as it does not familiar with conio.h,getch() etc. I use Dev c++. How can I solve … | |
I want to know how the structure of C++ program resembles to a client server architecture? | |
I know these functions in C, but in C++ they doesn't work. What is replacement for these functions in C++ ? Thanks. | |
Why almost always capital letters are used when defining macros or variables like [CODE]#define SOMETHING 432[/CODE] instead of [CODE]#define something 3243[/CODE] Also, why in macro definition x is used for example [CODE]#define macro(x) (x*x)[/CODE] Does the letter matter, and can longer variable names be used like [CODE]#define MACROSQUARE(variable) variable*variable[/CODE] | |
Whats wrong with this code.... [CODE]#include<iostream> #include<conio.h> using namespace std; int main() { int x,y; cin>>x>>y; while(1){ if((0<x<=2000)&&(0<=y<=2000)) { if((x<=y)&&(x%5==0)) cout<<y; //else if((x/2)>y) // cout<<y; // else // cout<<y; else { break; } }} getch(); return 0; } [/CODE] I want to print the single value of y.I do not … | |
I need to write a program which will execute a factorial, but with an upper and lower bound. Here's what I've written, but it's not working. I keep getting an error message on the for command with expression syntax. Please, I've got to have this and much much more by … | |
I have written a small client server program using tcp sockets, and i ran into trouble in retrieving the data brought in by the receive function. Like down below. [CODE] char *rec; int buff=1024; recv(a,rec,buff,0); [/CODE] You need a char buffer to get the data, but after that i wanted … | |
[CODE] cout<<"What HTH level are you (1,2,3): "; cin>>hthLevel; switch(hthLevel){ case 1:out<<"Hand to hand level= 1"<<endl;break; case 2:out<<"Hand to hand level= 2"<<endl;break; case 3:out<<"Hand to hand level= 3"<<endl;break; default: cout<<endl<<"Incorrect"; }[/CODE] Need to know how to loop this so if 1,2 or 3 is entered it continues but if an … | |
Can any one say why the [B]break[/B] state does not work. [CODE]#include<stdio.h> #include <stdlib.h> int main() { int n; loop: scanf("%d",&n); if(n!=42){ printf("%d",n); goto loop;} else { break; } return 0; } [/CODE] this is my code. | |
Hi, I have a .txt file containing information about 1000 events; each event lists 10-15 hit information. This number is not fixed. The format is given below: ================================================================= begin of event: 45 Hits(): X = 1.01101 Y = 1.01101 Z = 0.048 Hits(): X = 1.00502 Y = 1.02509 Z … | |
Hello, I have been working on an assignment using codeblocks with the GNU GCC compiler. The assignment must compile using Visual Studio 2008. I have not been able to get my hands on Visual Studio 2008 as of yet, but I was wondering if anyone thinks I should be concerned. … | |
I am at my wit's end with this thing. I just can't figure out, why I cannot set the WNDCLASSEX.lpfnWndProc equal to my class's function. Can someone help? Here's my code: system.h [code] #ifndef SYSTEM_H #define SYSTEM_H #include "stdinc.h" class System { private: void initD3D (void); void cleanD3D (void); LRESULT … | |
Hello Everyone, I am working on a program that will write random numbers to a file. I am getting the following error on line 31 of the filer.cpp file. "error: no match for 'operator<<' in 'outstream << srand((( srand(((unsigned int)time(Ou)))'" I believe the code used to generate the random number … | |
[CODE]#include <iostream> #include <fstream> #include <string> #include <sstream> using namespace std; int main(){ fstream First("firstt.txt"); fstream File("file.txt"); string firsttime; string blah1 = "enable"; string blah2 = "disable"; getline(First, firsttime); if(firsttime!="not"){ First << "not"; cout << "first time settings (to be changed at file.txt)" << endl << "allow every one enter? … | |
| Error C2662: 'Event::GetTime' : cannot convert 'this' pointer from 'const Event' to 'Event &'. This is my code: [CODE] #include <iostream> #include <queue> #ifndef Person_h #define Person_h #include "Person.h" #endif using namespace std; enum EventName { _SendMessageToUserInterface, _SetPNOld, _IntroduceInfection }; class Event{ int time; EventName name; Person person; public: Event(int … |
This is what i've made so far. [CODE]#include <iostream> #include <conio.h> using namespace std; int main() { int b=1; for (int i=1; i<=5; i++) { for (int k=1; k<=i; k++) { cout<<b; b++; } cout<<endl; } getch(); return 0; } [/CODE] The output is as below 1 23 456 78910 … | |
Look at this program compiled using [I]Turbo c++ 3.0 compiler[/I] Aim is [B]to calculate the factorial of a no[/B]. [COde]#include<iostream.h> #include<conio.h> long double factorial(int); void main() //main function { int inp; clrscr(); cout<<"Enter a positive no. "; cin>>inp; cout<<"factorial is :"<<factorial(inp);//displays factorial getch(); } long double factorial(int a) { long … | |
Hi, I have some experience with Visual C++. Recently I have been trying to develop on Mac OS X, and the IDE of choice is naturally XCode. It is very straightforward in VC++ to build the program in DEBUG configuration or RELEASE configuration. But as a newcomer for XCode, I … | |
Hi i Am A Newbie In This Website So Please Go Easy on Me. I Have Baisc Knowledge of C++ And I Do Projects on A Daily Basis, But I Have Never Tried Anything Related To Networking .So I am Asking How Can I Make A Chat Program With 2 … | |
Hello everyone, i write mostly in java but have recently started picking up c and c++, and i was wondering if there was an equivalent to the java date class in c++ or c? I've searched for a date.h and came up empty. | |
Basically I'm wondering what a sensible approach to learning Windows driver development would be. I have a logitech mouse that logitech decided to drop support for Vista/W7 on, and I'd like to write a driver for it but if that isn't possible it's fine and I would work with some … | |
Is there any easy way to view the full content of multidimensional arrays in VC++ 2010 in the debugger (or some other way I suppose)? | |
Hello there, I'm having some trouble trying to converting images/characters/strings/data into a byte array and then send them. In C++, I already have established a connection between the client - server and would like to send and receive data. Now I'd like to send an install file which is like … | |
Hi All, A newbie question and a really stupid one indeed:$ I want to store some incoming data into an array and then compare it with an array that I have defined. I am posting the program here but it is Arduino based and uses the Wire library. But I … | |
My program generates a list of random or pseudo random numbers between a certain range specified by the user through the console. My problem is when the user, or in this case myself, tries to generate a random number list specified by entering true(1) in the console the output is … | |
I have made a following program that will convert lower case letters in to upper case and upper case letters will remain same and that will be done Realtime (as character is typed). [CODE]#include<stdio.h> #include<conio.h> void main(void) { char ch; printf("Type a sentence: "); while (ch!='\r') { ch=getch(); if (ch … | |
Hi! I'm a newbie in this forum. I'm a novice C++ programmer and we are tasked to create a program with the following requirements: [QUOTE]Given the sequence of numbers [I][B]n a1 a2 a3 . . . an[/B][/I] a simple histogram should be printed to the computer screen. The number [B][I]n[/I][/B] … | |
hello, I have been working for the past few monthes on a c++ code generator and im finally at an alpha stage. The product generates code from a UML layout, however i have spent a fair amount of time searching for a compiler that will allow me to easily embed … |
The End.