49,755 Topics
| |
hi all, I am new to c++. I want to return array. I found that I have to use pointers but doesnt have idea. here is my code [code] // test2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; const int … | |
Hi all, I just try to input integer typed table rows into 2D integer array. I've tried the code below but it outputs me only last row :( [CODE] Input Table : ----------------------- id red green blue 1101 12 11 13 1102 12 12 14 1103 13 14 13 ------------------------ … | |
Below is my code to convert from decimal to binary: [CODE]#include "stdafx.h" typedef struct tamNode { int Into; struct tamNode *Next; }Node; typedef struct { Node *Head; Node *Tail; }List; void createList(List &l) { l.Head = NULL; l.Tail = NULL; } Node* createNode(int x) { Node *p; p = new … | |
I am making a program for my week 1 programming II class. The assignment is... Create a structure for a classroom. Make sure it includes the following: Room Number, Lecture Name, List of Students, Number of chairs, Window (Yes/No), Projector (Yes/No), Available(Yes/No). Instructions: • Create functions that allow you to … | |
What is the default calling convention of function used in C unless you define it implicitely? And write the different types of function calling conventions that the c99 standard dialect support? | |
Hi, I'm a student and I've been using Turbo C++ (v4.5) for over a year now (that's what they teach us at school). I just attempted to try writing a simple code in Microsoft Visual C++ 2010 Express. I've even had a few successful runs, but when I look into … | |
'Creating A Shared Assembly in .NET public class SharedObject Public Function Greeting(ByVal name as String) As String Return ("SharedObject says Hi : " & name ) End Function End Class | |
Hello DaniWeb, its been a long time! Anyway, I'm trying to put classes and functions inside .h files and define them in respective .cpp files. Whenever I try this, I get a weird error that I think has something to do with my constructor: obj\Debug\main.o||In function `_static_initialization_and_destruction_0': | main.cpp|33|undefined reference … | |
I found a tutorial on lazyfoo.net and when i downloaded the source it just opens and closes, why is this? im using code blocks. [CODE]/*This source code copyrighted by Lazy Foo' Productions (2004-2012) and may not be redestributed without written permission.*/ //The headers #include <SDL.h> #include <SDL_image.h> #include <string> //Screen … | |
Hi guys. I'm beginner in programing. I must write C++ program, but after 5 days reading in Google now I'm very confused(my hеad will explode). The problem is: Write a program to find the roots of quadratic equation(MFC AppWizard -> dialog based). Requirements: 1.use windows form(at least one button and … | |
Well, I just started programming in C++, this is my 3rd day and I finally built my first basic program. Just a basic calculator that takes two numbers and either multiplies, divides, adds, or subtract them. I do not know how to make a menu in C++ and I'm just … | |
Hello, I'm using SFML to make a game, and, as it has no built-in collision detection function, I made up my own algorithm. Here it is: [CODE] // Collision.cpp #include "Collision.h" Side CollisionBoxTest(sf::Sprite Hitter, sf::Sprite Hittee) { sf::Rect<int> HitterBox; sf::Rect<int> HitteeBox; // Initialize parameters for Hitterbox int BoxHeight = Hitter.GetHeight(); … | |
i have an excel sheet with me. i want 2 retrieve the data in c++ .. the retrieval should be in such a way that if a content of a cell is given it should tel me the content of the parallel cell .. i'm trying out alot for this … | |
How do they help with coding? They don't seem like it makes the code shorter so I'm confused... maybe I'm doing it wrong but... could anyone explain to me about enums and structures please? It'd be greatly appreciated, Merry Christmas! | |
let me know what flush(stdin) describe. is ti any kind of function or something else................... try resolve my problem | |
I am using GL_TRIANGLE_STRIP to draw my terrain to the screen, however when I compile and run the program I get nothing. When I change GL_TRIANGLE_STRIP to GL_LINES it shows up and works. What can I do to get it working with GL_TRIANGLE_STRIP? here is my draw code: [CODE] void … | |
Hi all, This is quite a specific question with a relatively large amount of explaining so ill try to make it really short to try save peoples time. In a nutshell what i have is a large csv file and im trying to search a particular entry (line in the … | |
Hi am trying to write a program and its giving me this error "cannot instantiate abstract class", can someone help me please? this is the code: Header: [CODE]#ifndef ABSTRACTGEOMETRICOBJECT_H #define ABSTRACTGEOMETRICOBJECT_H #include <string> using namespace std; class GeometricObject { public: GeometricObject(); GeometricObject(string color, bool filled); public: string getColor(); void setColor(string … | |
I need to write a code to be able to interpret the input date to calendar system. First input is the date and second input is the first day of the year. I dont know how to start. I hope someone could help me. Thanks 12/10/2011 S Output: October, 2011 … | |
Ok, here I come with a some sort of big analysis with pointer, array, vector, iterator and address of memory... using this input: [CODE] // hakim makan nasi // ayam yang basi // sambil tengok // hafiz yang tergelak // gelak [/CODE] with this code: [CODE] #include <cstring> #include <iostream> … | |
C++ emergency need this word doc to be done and i can't do it my self cause it bit to hard for me plz help Write a program to survey people, that will generate statistics about their age profile. It will firstly ask for the sample size. Then it will … | |
I'm new to c++. I was studying data structures and came to know Linked Lists Lately. We had a problem of finding an item stored inside a linked list and here's the code I wrote using Visual Studio to store and find an item. This code gives me a run … | |
Can anyone explain why I can't sort this vector: [code] #include <iostream> #include <vector> #include <algorithm> #include <memory> struct Test { public: Test(const unsigned int input) : a(input){} int a; }; struct SortFunctor { bool operator()(std::shared_ptr<Test>& object1, std::shared_ptr<Test>& object2) { return(object1->a < object2->a); } }; ////////////////////////// int main (int argc, … | |
Hi everybody, Is it possible to write a c++ compiler in c++ ? Its bootstrapping, right ?? In which language are usually written compilers ? Thanks | |
I have a piece of software, that I would like to license and protect but I am having a hard time finding the right license, and how I would go about with it. Is there a license that allows: - Free distribution of the executable and DLL's - Costs money … | |
This is a way to force a given aspect ratio of a window any time the user tries to resize or cascade it. [CODE] double aspectRatio = 640.0 / 480.0; WPARAM sideBeingDragged = 0; LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); … | |
I have an idea for a program but I don't know if its possible. I want to write a program that can read commands from a file.. For example, I've seen bots that can parse and read javascript for games and execute whatever is in the .java file.. How can … | |
C++ course has started in my college. I would like to know the best beginner book for C++. My teacher has referred Robert Lafore and The Complete Reference. Since there are a lot of suggestions given in the sticky thread, I am confused. Thanks in advance :) | |
I have a Win32 Application in C++. At runtime, It loads a Matrix stored as TXT file in the working directory with I/O functions. I have problems to distribute my program (EXE and DLL) because people normally forget to move the text files together with the Application. How can I … | |
at first, plec correct me this one... [code] std::string explanation; // this upper coding char explanation; //after entering void to display if(item_code=='A') explanation='BABY WEAR'; else if(item_code=='B') explanation='CHILDREN WEAR; else if(item_code=='A') explanation='LADIES WEAR'; else if(item_code=='A') explanation='MENSWEAR';[/code] BABY WEAR and others was error, what should i put? plz correct my coding above … |
The End.