49,766 Topics

Member Avatar for
Member Avatar for vyrte

hello everyone! i'm writing a program where i want to choose a random double but not greater than "i" which is a specific value --lets say 60--i'm doing the following: [CODE]double b = rand()%i+1[/CODE] and i get the error while compiling : [I][U]invalid operands of types 'int' and 'double' to …

Member Avatar for vyrte
0
237
Member Avatar for mitrious

I have a node class that has a Node* parentNode atribute. My constructor is as follows: [CODE]Node::Node(Node* p,const State& s, int d) : parentNode(p), currentState(s), depth(d){ }[/CODE] BUT with this constructor I get a problem: I'm using this class to run a AI Search and at depth 3 it generates …

Member Avatar for mitrious
0
213
Member Avatar for Zssffssz

I'm trying to write an echo like thing doing this : [CODE]> echo Muffins Muffinst > echo two muffins two muffins[/CODE] The problem Is that the program isn't being started from command line, The > is my programs input prompt (trying to write a very simple command line) How would …

Member Avatar for WaltP
0
259
Member Avatar for rotemorb

Hello I'm quite new to Jquery, so bare with me please. I've searched google, but I couldn't find an answer to my question. I'm developing an asp.net 4.0 application, and i wrote a Jquery inside my content page: [CODE] $(document).ready(function () { $("#Button1").click(function () { alert("Hello"); }); }); [/CODE] I …

0
69
Member Avatar for KasmIR

[CODE]for ( i=0;i<a;i++ ) { qin.Echo(); qin>>b; if(b == (char)8) { total--; cuv[i-2]=cuv[i-1]; cuv[i-1]=0; i--; } else if(b!=char(13)){ // for key enter total++; space++; cuv[i]=b; } else break; } [/CODE] If pressed once or twice "backspace" works, but if pressed for more than two times, not working, first i checked …

Member Avatar for KasmIR
0
80
Member Avatar for james6754

[CODE] class Matrix { public: int M; int N; double *ptr; Matrix(int m,int n)//constructor takes two ints { M = m; N = n; ptr = new double[M][N]; assign(M,N);//call function } void assign(int M,int N)// method { for(int i = 0; i < M;i++)// i is a row { for …

Member Avatar for james6754
0
144
Member Avatar for tobo

hello i have a problem to solve for a commandline-programm: there are several types of inputs to get and these can look like: keyword1 <double> value1 <double> value2 keyword2 <double> value1 keyword3 <double> value1 ... I just can't figure out how to do it! thanks!

Member Avatar for tobo
0
319
Member Avatar for Despairy

Hi, lets say i have [CODE]class Players{ public: vector <strings> info };[/CODE] and class that inherits from it [CODE]class son:public Players{ };[/CODE] now in the main function i make 2 of those so now i have 2 vectors in memory that vector holds the same data for all of the …

Member Avatar for Ancient Dragon
0
258
Member Avatar for SoulMazer

Hi, I'm a beginner to C++ and am having some trouble with my list. I first define a struct named "bullet' like so: [code=c++]struct bullet { bool alive; bullet() alive = true; };[/code] Then, I create a list of objects of type "bullet": [icode]list<bullet> bullet_list;[/icode] In my program, I frequently …

Member Avatar for saravmittar
0
197
Member Avatar for jonnyboy12

Hello all i am just getting into using windows forms. I have been looking around on the internet for like a day now and cant seem to find any good code on how to add a table with columns , rows and labels on the top of the columns. I …

Member Avatar for thines01
0
91
Member Avatar for Clinton Portis

Fun game for the raging compulsive alchoholic gambler, such as myself. Although the game may vary among casinos, the basic premise is the user picks 10 numbers out of 80. The computer will randomly draw 20 numbers out of 80. If you matched with any of the computer picks, you …

Member Avatar for PrimePackster
0
1K
Member Avatar for jman2011

I am new in programming. I have this problem in coding. i somehow have the idea but i could not simply do it in codes. can anyone add to complete my program. The problem is I enter 10 numbers and i need to sort them ascendingly. #include<iostream> using namespace std; …

Member Avatar for jman2011
0
86
Member Avatar for StickyTape

I use Visual Studio 2010 Ultimate. After fixing one of my problems, I ran into another. I have 2 files in my project named, let's say, A and B. The problem is when I try to run the code from B, VS outputs code from A. Any ideas on how …

Member Avatar for Crosby Grant
0
2K
Member Avatar for Odanaga

Hello, everyone! I made an account on this website because I'm having trouble with a particular program. I'm supposed to be writing a Polynomial class with a linked list to hold coefficients and an integer for the degree. I keep getting a fatal error LNK1561, though, and I don't know …

Member Avatar for Odanaga
0
390
Member Avatar for freedomflyer

I think I have the logic mostly down for this part of the program. However, I am using an implementation of a header file, and in [B]BST::Insert[/B] I am handed a [B]const std::string &v[/B]. For all I know, it is doing the right job passing it off to [B]InserRecursive[/B], but …

Member Avatar for freedomflyer
0
136
Member Avatar for Forswear

Hey there,I'm looking for assistance with my simple code here. Why do my integers ( x,v,z,d,e,f,g,h ) suddenly change when the program reaches the " printf("The decimal value is... " part? Is there something I'm missing? [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int Binary[7],x,v,z,d,e,f,g,h; Binary[0]=x; Binary[1]=v; …

Member Avatar for <ccg>
0
490
Member Avatar for lbgladson

I have an assignment to get the area and perimeter of a rectangle. I have to set the width and length to 1 initially and use set and get functions. I have the following code but am not getting the correct answers for area and perimeter. Any suggestions? Rectangle.h [code] …

Member Avatar for Moschops
0
1K
Member Avatar for swissknife007

[CODE] #include<stdlib.h> #include<conio.h> #include<stdio.h> #include<iostream.h> struct pro { int no; int btime; int atime; int stime; int etime; int wtime; int ttime; int rtime; }proc[100],junk; void sort(int n) { pro temp; for(int i=0;i<n;i++) for(int j=0;j<n;j++) { if(proc[j].atime>proc[j+1].atime) { temp=proc[j]; proc[j]=proc[j+1]; proc[j+1]=temp; } } } pro min(int n,int & t) { …

Member Avatar for swissknife007
0
3K
Member Avatar for avenger123321

[QUOTE]I was given this project as a part of my school assignment, please note that I have very limited knowledge of the language, and my teacher won't allow using anything other than what is used in the following code (Crappy 12th grade curriculum:yawn:)... Here is my complete code, its in …

Member Avatar for avenger123321
0
357
Member Avatar for hmartinez

Hello, I have a strange problem. I am trying to use the tesseract library in my own project. First, I have used it in a new project, just to test it, and everything has gone fine. After that, I have integrated in a bigger project in the same way as …

Member Avatar for hmartinez
0
502
Member Avatar for ahoysailor

Hi, I'm having a problem with using the streamWriter to write to a unicode file. Code as follows: [CODE] for(int i = 1; i < 1018; ++i) { std::wostringstream integer; integer << L"IDS_STRING" << i << L"\t"; wstring thisString = integer.str(); thisString = thisString + L"\"Spare String\""; wchar_t* SpareString = …

Member Avatar for thines01
0
226
Member Avatar for anuj.juthani

i am a beginner in visual c++ and using visual studio 2010, i have came across a scenario where i want a dialog screen to appear in a full screen mode like our youtube video screen. i was successful to make the dialog box appear on the full screen , …

0
76
Member Avatar for Alexis913

I am trying to launch a process using CreateProcess() I have to modify the Path environment variable as well as add some environment variables of my own. What I am doing is I get the parent's environment block using GetEnvironmentStrings(). I basically copy the parent env block and only modify …

Member Avatar for Alexis913
0
5K
Member Avatar for triumphost

I read a LOT of tutorials on bitmaps. I learned that RGBQuad is for 32 bit bitmaps and RGBTripple is for 24 bit bitmaps.. I'm planning on getting pixel information from a bitmap that can be of 3 types. 24bit, 32bit, 32bit with alpha (Transparent). Thing is, I don't know …

Member Avatar for triumphost
0
200
Member Avatar for kukuruku

Hi ,I am trying to implement merge sort with list and I have this error in this code [COLOR="Red"]invalid use of void expression[/COLOR] list<string>::iterator LIST_ITER; sz is the size of the list beg beginning of the list end end of the list Thank you in advance [CODE]void merge_sort(LIST_ITER beg, LIST_ITER …

Member Avatar for mrnutty
0
88
Member Avatar for firebird102085

HI everyone, like my last post stated I am new to programming so be patient with me. I am having a hell of a time writing this program and I was hoping some of you might be able to give me some quick pointers on the structure I should use. …

Member Avatar for KasmIR
0
132
Member Avatar for arold10

I am writing a program about giving change. But I am having issues with getting remainders for decimal numbers. For instance I am giving $46.63 change I want to know how many $20.00 bills it has, I would have to divide it by 20. 46.63 / 20 = 2.3315 My …

Member Avatar for Ancient Dragon
0
120
Member Avatar for sodha125

Write a program which asks the user to write some text before analysing it to see how many occurrences of each vowel appears in that text, you should store the number of occurrences of each vowel in an array of size 5. (Hint: use qin for this, with the ‘Return’ …

Member Avatar for KasmIR
0
199
Member Avatar for Aniqa Shaikh

Hay guys, i wanted to get the code for a very large factorial but i was unable to do so. Now, i had to work and develop the code myself, which i did. This code calculates factorial of numbers uptil 14000. . i havent tried more. But i guarantee this …

Member Avatar for sameershah21
1
666
Member Avatar for tux4life

I've written a program to add two hexadecimal numbers ... Njoy ! tux4life

Member Avatar for alebuddy
0
1K

The End.