49,755 Topics

Member Avatar for
Member Avatar for devindamenuka

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 …

Member Avatar for cool_zephyr
0
389
Member Avatar for smurfy

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

Member Avatar for thines01
0
152
Member Avatar for manhthaodn

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 …

Member Avatar for WaltP
0
387
Member Avatar for Zvjezdan23

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 …

Member Avatar for Schol-R-LEA
0
101
Member Avatar for kkevinnnn

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?

Member Avatar for mike_2000_17
-1
154
Member Avatar for aashishsatya

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 …

Member Avatar for thines01
0
191
Member Avatar for kkevinnnn

'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

Member Avatar for thines01
0
109
Member Avatar for Hawkpath

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 …

Member Avatar for Hawkpath
0
8K
Member Avatar for ChrisMackle

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 …

Member Avatar for m4ster_r0shi
0
218
Member Avatar for mncoc

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 …

Member Avatar for mncoc
0
161
Member Avatar for KingAudio

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 …

Member Avatar for eckoro
0
143
Member Avatar for Chuckleluck

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

Member Avatar for Eagletalon
0
211
Member Avatar for akshatha.ullur

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 …

Member Avatar for DJSAN10
0
140
Member Avatar for lolwaht

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!

Member Avatar for mrnutty
0
96
Member Avatar for Webmastergrace

let me know what flush(stdin) describe. is ti any kind of function or something else................... try resolve my problem

Member Avatar for WaltP
0
72
Member Avatar for Orange9876

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 …

0
71
Member Avatar for Kanoisa

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 …

Member Avatar for Kanoisa
0
1K
Member Avatar for FEC

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 …

Member Avatar for Kanoisa
-1
377
Member Avatar for ultrAslan

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 …

Member Avatar for bbman
0
174
Member Avatar for Vasthor

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

Member Avatar for Narue
0
214
Member Avatar for doma18

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 …

Member Avatar for pseudorandom21
0
240
Member Avatar for harsha_123

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 …

Member Avatar for harsha_123
0
1K
Member Avatar for daviddoria

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

Member Avatar for vijayan121
0
3K
Member Avatar for Karlwakim

Hi everybody, Is it possible to write a c++ compiler in c++ ? Its bootstrapping, right ?? In which language are usually written compilers ? Thanks

Member Avatar for vijayan121
0
191
Member Avatar for BCBTP

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 …

Member Avatar for vijayan121
0
193
Member Avatar for Sarkahn

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

0
414
Member Avatar for triumphost

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 …

Member Avatar for triumphost
0
175
Member Avatar for lastbencher

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

Member Avatar for lastbencher
0
224
Member Avatar for harvybcn

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 …

Member Avatar for alexb119
0
2K
Member Avatar for khelly

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 …

Member Avatar for gusano79
0
163

The End.