49,757 Topics

Member Avatar for
Member Avatar for new_developer

Hello everyone ! I want to get output in C++ in same line. The following code gives me output in separate line. for(int i=0; i<=10; i++) { cout << i <<" " <<endl; }

Member Avatar for new_developer
0
1K
Member Avatar for kuki123

am having a problem in incrementing the number automically into the database every the when save. The initial number i want it to be 001 in a text box and when i save it, it should increment into 002 and so on. And every time i load the web page …

Member Avatar for Schol-R-LEA
0
181
Member Avatar for daino

This is probably a silly question but i really don't know the answer to it. Can you write a program in C++ and have another part written in C and compile them into a single executable file? I'm thinking a c/c++ compiler like visual c++ would do this.. Is that …

Member Avatar for rubberman
0
260
Member Avatar for triumphost

Can anyone check my memory class and suggest changes or things I may need? I'm writing it so that I don't have to worry about deleting anything everytime I allocate. #include <iostream> template<typename T> class Memory { private: size_t size; T* data; public: explicit Memory(size_t Size) : size(Size), data(new T[Size]){} …

Member Avatar for rubberman
0
137
Member Avatar for poloblue

Good Afternoon, This is my first class in C++ and I'm having problems with a program that needs to print a calendar of June, July and August 2008 into the output file "outCalendar.txt" . I should format the result for month well so that it looks like a real calendar …

Member Avatar for Schol-R-LEA
0
397
Member Avatar for VernonDozier

This program does not crash but behaves badly due to not allocating enough space for vector z in line 21. If I comment out line 21 and instead uncomment line 23, things work well. If I comment out both lines 21 and 23, the program will crash, presumably because I …

Member Avatar for VernonDozier
0
379
Member Avatar for triumphost

What's a fast way to fill a union/struct of integral members with ALL Zeroes? RECORD* UNION = {0}; void ZeroStruct(int X, int Y) { UNION = new RECORD[X * Y]; int K = 0; for (int I = 0; I < X; I++) for (int J = 0; J < …

Member Avatar for mike_2000_17
0
268
Member Avatar for triumphost

Is it possible to overload one operator more than once? I have a struct that is just my idea of a C++ Box. I'm trying to increase the size of a box using an integer or another box. I'm trying to do: Box X(0, 0, 0, 0); Box Y(1, 1, …

Member Avatar for triumphost
0
2K
Member Avatar for mike_2000_17

I am currently working on kind of multi-graph structure. The thing is that two graphs are needed for my application which span the same vertices but with two distinct set of edges (i.e., a multi-graph). The first graph is a binary search tree, while the second graph must be general …

Member Avatar for mike_2000_17
0
674
Member Avatar for funkey100

Hey, I am trying to make a C++ scrit that decodes and encodes tenis polar (search it on Google if you don't know what it is). After some testing, I found out my application stops after the strcpy. Any help? The code is below. Thanks! #include <iostream> #include <cstring> #include …

Member Avatar for Schol-R-LEA
0
307
Member Avatar for missil9

Hey all, I usuallly don't like asking for help on these sites but I have been kicking myself for a while now implementing boost regex for a program (i have never had any prior issues). I believe the issue is with my regex syntax but i have tried numerous variations …

Member Avatar for missil9
0
315
Member Avatar for triumphost

I have a union defined as so: typedef union RGB { unsigned Color; struct { unsigned char B, G, R, A; }; } *PRGB; I'm reading 32 bit and 24 bit bitmaps. I'm trying to Read Pixels from my RGB union and set pixels as well. I know bitmaps are …

Member Avatar for triumphost
1
439
Member Avatar for Nikhar

The following is my code for Edit Distance problem. The problem asks us to find the edit distance between two strings. My code, I think gives the correct output. If I run the code with two strings of 1500 length each, I get the error. But if I run it …

Member Avatar for Nikhar
0
297
Member Avatar for Albino

I have a problem. 1>------ Build started: Project: SDL Test, Configuration: Debug Win32 ------ 1> playa.cpp 1> main.cpp 1> Generating Code... 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load_image' : not all control paths return a value 1>c:\users\will\documents\visual studio 2010\projects\sdl test\sdl test\main.cpp(43): warning C4715: 'load_image' : not all control paths …

Member Avatar for Albino
0
463
Member Avatar for nuclear

So I was trying out SDL_gfx lib and tryed using the rotozoomSurface() [Click Here](http://www.ferzkopp.net/Software/SDL_gfx-2.0/Docs/html/_s_d_l__rotozoom_8h.html#a3cb0c11d5edc929579c807dc7612348c) which should've rotated my surface at runtime, but it seems that whenever I do that my surface turns invisible. It doesn't matter if I predefine the rotation or use it at runtime, the same happens, I've …

Member Avatar for nuclear
0
232
Member Avatar for Patiodude

I'm very new to C++; can a program be started with anything other than `int main`? And what, exactly, is the purpose of the `main` part, anyway?

Member Avatar for VernonDozier
0
183
Member Avatar for Jackk123

#include "stdafx.h" #include <iostream> using namespace std; int main () { int a, b, c; cout << "š"; cin >> a; cout << "Č"; cin >> b; c = a+ b; cout << "Ć" << c << endl; return 0; } So i tried using characters from my own language …

Member Avatar for Jackk123
0
872
Member Avatar for cool_zephyr

hello everyone..i've vs2010 in my system..and i'm trying to build a simple web browser using webkit..could anyone please tell me what do i need to install to be able to work on vs2010?? and a simple demo code about how to use the webkit sdk..i've searched a lot on google..but …

Member Avatar for cool_zephyr
0
500
Member Avatar for tomtetlaw

I'm using VC++ 2010 with Windows 7 x64. I'm compiling all my code as C code. I have a for loop like this: for (i = 0; i < max; i++) { ... } But when I run it, `i` is being set to `max` If I set `i` to …

Member Avatar for DeanMSands3
0
147
Member Avatar for tensity

#include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { float annualIntRate, principle, monthlyPayment, monthlyIntRate, totalAmt, intPaid; int yearsBorrowed, numPayments; cout << "This program computes information associated with a loan" << endl; cout << "Please input the Annual Interest Rate:" << endl; cin >> annualIntRate; cout << "Pleast …

Member Avatar for tensity
0
125
Member Avatar for tubzz

Dr Mirna always gives True/False tests to her class. Her tests have always 10 questions. The maximum class size is 5. She needs a program that will calculate the students’ grades based on the best grade. Grade A will range from the best score, to the best score minus 2. …

Member Avatar for deceptikon
0
667
Member Avatar for coffecat

So i wanted to write a Hangman game and i started it, as im newbie programmer it took me several days to track all the bugs etc. Meanwhile i want to get good habits on designing and i read that Getters and Setters arent the best way to go for …

Member Avatar for Schol-R-LEA
0
318
Member Avatar for phfilly

Hi -i've started using netbeans and compiling in it recently and I'm not sure what the problem is here. Not sure if it isn't reading the Element.cpp/.h files while building/running the main.cpp In my main: Element a, b(5); cout<<(5+b)<< endl; Then in the .h: Element operator+(const Element&obj); And in the …

Member Avatar for rubberman
0
165
Member Avatar for lostinthespiral

I am new to programming and am having REAL trouble trying to output Pascal's Triangle (formatted into a triagle) using multidimensional arrays. I would really appreciate some help. In the program, the user is supposed to input the # of rows desired (up to 15... or else it won't fit …

Member Avatar for deceptikon
0
829
Member Avatar for stereomatching

I found a lot of books introduce about objective C but can't find a book which talk about objective C++.Could you introduce me an objective C++ textbook? I learned C++ before but don't know objective C, where should I start if I want to learn objective C++?Looks like it is …

Member Avatar for stereomatching
0
417
Member Avatar for tubzz

Assume that the following data is stored in file “data.txt”: 2 5 7 1 12 -999 1 4 11 55 66 3 43 23 -999 9 87 56 34 22 12 21 -999 8 7 5 4 6 111 -999 The number -999 at the end of each line acts …

Member Avatar for tubzz
0
189
Member Avatar for j509

Display a product number, name (or description), and price for four retail products. They could be food, clothing, auto parts, plants, tools, kitchen utensils, or any other type of retail product. Prompt the user to enter the product number of each product they wish to buy, one at a time, …

Member Avatar for j509
0
962
Member Avatar for s0urce

The program runs but I can not get it to add the totals from the three employess. Then when i enter an employee info the totals show after each employee instead of the end. Please help. If you can please explain what I need to do in simple terms. Its …

Member Avatar for s0urce
0
131
Member Avatar for phorce

Hello, I'm looking for some advice (NOT CODING) on a project I'm hoping to start.. Basically, I'm hoping to develop some shell commands that work a tiny bit like Github (if you are familular with it).. The language that I want to use is C++.. Could anyone offer any advice …

Member Avatar for Schol-R-LEA
0
136
Member Avatar for vorlic

i was told tht from this: int main () { int i,j,vsota; for (i=1; j=10; i<=j; i++) { vsota=vsota+i+j; j--; } system ("pause"); return 0; } i must make it work with while ; but the oruginal doesnt work allso what should i doo??; please any help;? #include <iostream> using …

Member Avatar for marh
0
220

The End.