43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for shadow_shooter

Hi, I want to scan a word from the user and store it in a char pointer. But I couldn't do it. The thing I just want as the following: char *word; scanf("%s",word); but, it doesn't work... please help for this simple problem. it sounds a bit noob, i know...

Software Development c
Member Avatar for Salem
0
2K
Member Avatar for Ben10

Hello everyone! I need a C++ program that stores the results of product table from 1 to 10 in two-dimensional array... what i did : [code=c++]#include<iostream.h> void main() { int a[5][2],result; const int k=1; for(int f=1;f<=10;f++) result=k*f; for(int i=0;i<5;i++) { for(int j=0;j<2;j++) { a[i][j]=result; cout<<"a["<<i<<"]["<<j<<"]="<<a[i][j]<<endl; } } }[/code] BUT the …

Software Development c++
Member Avatar for Ben10
0
88
Member Avatar for sonia sardana

To Create a toolbar we drag the pricturebox & then the image. Suppose I want that the text is there in place of image ,Is it possible ??

Software Development visual-basic
Member Avatar for sonia sardana
0
196
Member Avatar for it2051229

I'm creating a simple C# program that deals with pressing the DELETE key button in the keyboard. so what I created a key press event, but seems like the delete key doesn't work.. i tried it with other keys and it's working fine... why?? and is 46 the keycode for …

Software Development c c# c++
Member Avatar for Jx_Man
0
2K
Member Avatar for aminit

Hello : I 'd created a simple form , it consist of 2 set of checkboxs 1-6 checkboxes 2-6 checkboxes I want to make a simple function determine if the first checkbox in set1 is checked it must test the checkboxes in set2 if the first is checked too or …

Software Development
Member Avatar for aminit
-1
175
Member Avatar for scaraffe

I was learning about structures in C++. I had a question: [code] 1.struct integer 2.{ 3. int i; 4. integer (int j = 0) : i (j) {}; 5. integer operator* (const integer &k) const 6. { 7. return integer (i + k.i); 8. } 9.}; [/code] In the above …

Software Development c++
Member Avatar for Salem
0
104
Member Avatar for jennyebrooke

I need to know how to have the user answer a question using yes or no and the program translating it into 1 or 0. I know this process involves a string... but anymore than that and I'm kinda lost. **Fixed second problem with the if else statement but still …

Software Development c++
Member Avatar for jennyebrooke
0
182
Member Avatar for xRuP7uR3x

Greetings everyone. I have been working on a script to convert a number from any base to any base up to base62. The user supplies the original number, the starting base, and the end base. My problem arises when converting the fractional part from base10 to the end base; the …

Software Development algorithm python
Member Avatar for jrcagle
0
156
Member Avatar for mnv29brt

[COLOR="Red"]Poly.h[/COLOR] [code=cplusplus] #include <iostream> using namespace std; #ifndef POLY101 #define POLY101 class Poly { [B]private:[/B] int order; double *a; // Coefficient vector -- a[0], a[1], a[2], ..., a[order] // to represent a[0] + a[1]*x + a[2]*x^2 + ... public: Poly(int = 0); // Default constructor Poly(const Poly &p); // Copy …

Software Development c++ os-x
Member Avatar for dougy83
0
4K
Member Avatar for NycNessyness

Hello guys. I needed some help with my calculations. I'm having a problem with having my output display the total amount. I believe the problem is coming from trying the float calculation.

Software Development java
Member Avatar for NycNessyness
0
104
Member Avatar for tformed

Can all for statements be written as while statement. Vice Versa?

Software Development c++
Member Avatar for dougy83
0
89
Member Avatar for clueless101

I need to design an Ages class with fields to hold 3 ages and includes a constructor, accessor and mutator method. Also needed is a method that returns the average of the ages. I also need to write a demo class that creates an instance of Ages class. The demo …

Software Development java
Member Avatar for clueless101
0
148
Member Avatar for ITKnight

Please see my code : [CODE] using System; using System.Collection.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void cmdtam_Klik(object sender, EventArgs e) { string cstr; cstr = "data source=knight;initial …

Software Development dataset display open-source
Member Avatar for Jx_Man
0
404
Member Avatar for Mr.Wobbles

I am writing a program that will take input from the user in the form of a tree-view and create a form and a database based on the tree-view. I have everything working except the group-box control for the boolean expression. I will give a sample code of the text …

Software Development visual-basic visual-studio
Member Avatar for Mr.Wobbles
0
144
Member Avatar for maydhyam

Hello, I need some help....I have to create part of an application that uploads an MS Excel file, and stores the data into a MySQL db...and I have no clue where to start...

Software Development java mysql
Member Avatar for Ezzaral
0
114
Member Avatar for Lensva

the code is supposed to take 1-10 char word and copy the word into another array. it somewhat does that but some mysteries are included [code=c++] #include <iostream> using namespace std; int main() { char word[10]; cin>> word; char *Arr; int index=0; for (int i=0; i<10; i++) if (word[i] >= …

Software Development c++
Member Avatar for Ancient Dragon
0
95
Member Avatar for programmer321

Hello, I have written a test code for signal handling. The code is compataable for both Windows and Linux. The code is as: [code=c] #include <signal.h> #include<stdio.h> #include<string.h> #include <sys/types.h> #ifdef WIN32 #include <windows.h> #else #include <unistd.h> #endif void intr_hdlr(void); void intr_hdlr2(void); int cnter=0; int sig_cnter=0; int main () { …

Software Development c
Member Avatar for programmer321
0
175
Member Avatar for blaec

Hi I need some help with these C++ programs in Dev C++: #include <iostream> using namespace std; int main() { std:string str, str2, str3; std::cin >> str; std::cin >> str2; std::cin >> str3; std::cout<<str.length()<<std::endl; std::cout<<str2.length()<<std::endl; std::cout<<str3.length()<<std::endl;[/QUOTE] I type in a word for each string and I want to organise the …

Software Development c++
Member Avatar for blaec
0
209
Member Avatar for JFBiomed

I've got some fairly expansive code for musculoskeletal simulations that I'm altering. I've double and triple checked my code segments, but I've been banging my head against this particular error for some time. I'd appreciate any elucidation you kind fellows can pass my way. If any further code, etc would …

Software Development c
Member Avatar for JFBiomed
0
244
Member Avatar for Google Spider

Hi, This program is supposed to ask the user how many numbers they want to sum up and then take all the numbers one by one to give the final result. Its working but perhaps you all professional programmers will point out some flaws in it. [CODE] #include <iostream> using …

Software Development c++
Member Avatar for Agni
0
110
Member Avatar for staneja

I am trying to display an Image using applet. Image is updated after every 4 seconds so i want my applet to show updated image.I am not sure where i should load the image i have tried to load it in the init() method as well as in "start" method …

Software Development image java
Member Avatar for staneja
0
102
Member Avatar for veronicak5678

I am trying to write two programs to work in conjunction. The first is a bibliography program that writes book info to a file; That's ok. Here's what I did: [CODE]#include <string> #include <fstream> #include <vector> #include <iomanip> #include <sstream> #include <iostream> #include <iterator> #include <vector> // vector class-template definition#include …

Software Development algorithm c++
Member Avatar for veronicak5678
0
150
Member Avatar for mnv29brt

//To check if there is a win #include <iostream> #include "tictactoe.h" using namespace std; int win(char board[3][3]) { for(int i=0;i<3;i=i+1) { if ((board[0] == 'x' && board[1] == 'x' && board[2] == 'x')|| (board[0] == 'o' && board[1] == 'o'&& board [2]== 'o')) return 1; else if((board[0] == 'x' && …

Software Development algorithm c++
Member Avatar for mnv29brt
0
125
Member Avatar for cobberas

Hi all I'm trying to create a dynamic array of structures and have come across the following code but I can't figure out how some of it works: (incidentally this is from Prata's book C++ Primer Plus, Ch4, Ex.9) [code=syntax] #include <iostream> using namespace std; int main() { //structure declaration …

Software Development c++
Member Avatar for vmanes
0
238
Member Avatar for Suraine

:confused: Arrgh!!! Cant understand these sentence from this website of brickos programming: [URL="http://legos.sourceforge.net/HOWTO/x600.html"]http://legos.sourceforge.net/HOWTO/x600.html[/URL] [code]random() and srandom(int x) are now available in legOS. To use them, just call srandom(int x) at some point during your program startup. x is a "seed", which allows you to get the same sequence of numbers …

Software Development c++
Member Avatar for Suraine
0
253
Member Avatar for coolbreeze
Member Avatar for electromania

In the below code im getting a year from the user. but when I print of the year from scanf is doesnt print the correct value such as 2010 will be printed as 74.43434 (somthing like this). If i change the scanf from %.3lf to %f or %d the program …

Software Development c
Member Avatar for electromania
0
86
Member Avatar for shadow_shooter

Hello everyone, I'm working on a project, each time two numbers are read from a text file. Text file contains two lines of sequational numbers, something like this: [ICODE] 4 5 2 1 10 8 3 4 6 1[/ICODE] I have two linklists and each node is able to store …

Software Development c
Member Avatar for shadow_shooter
0
304
Member Avatar for Nemoticchigga

Is there a way to cast a the contents of a char* buffer into an int?

Software Development c++
Member Avatar for Nemoticchigga
0
83
Member Avatar for Time Indicator

Hi, I have a question regarding my vb.net code. I have a button called 'Add New Item', when the user clicks on that button, the text fields should be clear. I tried this code 'txtAddNewItem.clear() and this code too 'txtAddNewItem.Text = "" ' , but I am getting an error, …

Software Development vb.net
Member Avatar for Jx_Man
0
163
Member Avatar for Taker

[code] #include <stdio.h> struct places { char places1[100]; char places[10][10]; int distances[10][10]; }; main() { int menu; char userinput1[10]; char userinput2[10]; char userinput3[10]; int cost; int other; int a; int b; int c; int distances; char places[50]; struct places names[10]; FILE *fp; /*creates a file pointed named fp*/ /* reading …

Software Development c
Member Avatar for Taker
0
233
Member Avatar for Lensva

I'm trying to make so it would check if letter i and i+1 are alike. If so it'd drop "denied" else "accepted". i dont understand what I did wrong though: [code=c++] #include <iostream> using namespace std; int main() { char pass[5]; bool correct=false; cout<< "pass: "; cin>> pass; for (int …

Software Development c++
Member Avatar for Lensva
0
93
Member Avatar for CodeBoy101

Hey wassup? I need to know how to detect arrow keysand the escape key, and any help would be greatly appreciated, thanks!

Software Development c++
Member Avatar for CodeBoy101
0
351
Member Avatar for sonia sardana

Private Sub Command1_Click() Dim a, b As Integer a = 10 b = 20 sum1(a,b) End Sub Private Sub sum1(a, b) Dim c As Integer c = a + b Print c End Sub i have called the procedure bu simply the procedure name & arguments within the parentheses as …

Software Development vb.net visual-basic
Member Avatar for choudhuryshouvi
0
96
Member Avatar for spuddy1515

These is my code and i need to change it so that the second out put replaces the first and so on. [code]#include <iostream> #include <stdlib.h> using namespace std; int main() { int a = 0; int h; int m; int s; mistake: cout << "What is the current hour?\n"; …

Software Development c++
Member Avatar for spuddy1515
0
118
Member Avatar for ajithraj

haii I have a problem while accessing a class(A) through "reflection" from class B.... i want to pass a parameter to class A... My code is like this... Method idMethod = Class.forName(ClassName).getMethod(FunctionName,null); Method getMethod = Class.forName(ClassName).getMethod("getInstance", new Class[]{Class.forName("java.lang.String")}); Object object = getMethod.invoke(Class.forName(ClassName()),new Object[]{dboption}); lists = (ArrayList)idMethod.invoke(object,personId); i will get correct …

Software Development java
Member Avatar for Ezzaral
0
125
Member Avatar for relm86

Hi I just started to learn to program and I choose python cause I heard it was easy to learn. But I already ran into proably a very stupid problem that a only a noob like me would need help with. I'm using idle to program with in windows and …

Software Development python
Member Avatar for ZZucker
0
111
Member Avatar for sjcomp

Hello, I'm using Microsoft Visual Studio 8.1 (2005) to compile and link a library and my application that uses this library. Linking complains that a symbol can not be found. I looked at the lib file and this is what happens: [code] dumpReadable@OGRGeometry@@UBEXPAU_iobuf@@PBD@Z - Lib has this dumpReadable@OGRGeometry@@UAEXPAU_iobuf@@PBD@Z - My …

Software Development c++ visual-studio
Member Avatar for sjcomp
0
111
Member Avatar for rikkie

Hi guys, Could someone point me in the right direction, please? I'm trying to expand my system to accommodate the reservation of consecutive seat numbers. The user is prompted for a row number, seat number and then the amount of consecutive seats he would like to book. For example: The …

Software Development c++
Member Avatar for rikkie
0
180
Member Avatar for Peppercat101

Im writing monopoly, Im still a beginner so please help.... I wrote this for loop but for some reason it starts at 28 and not at 1.... For r := 1 to 28 do If STekoop[1,r] = plek then If messagedlg(STeKoop[r,2] + ' FOR SALE.' + #13 + 'Price: ' …

Software Development delphi pascal
Member Avatar for Peppercat101
0
122
Member Avatar for Samudricka

i am trying to remova last tokenised string as i am mentioning in below sample....i have stored a data in a hashtable like this.....[ICODE]Hashtable h = new Hashtable(); h.put("111", "A/B/C/d"); h.put("222", "A/B/C/D/e"); h.put("333", "A/B/C/f"); h.put("444", "A/B/C/D/E/g"); h.put("555", "A/B/R");[/ICODE] in order to tokenise these strings and to remove last elements.......for example....here …

Software Development java
Member Avatar for Samudricka
0
94
Member Avatar for Kusno

Dear all, I'm sorry to ask you again. This code is my jTable that I copy from my Netbeans source code. tblGroupAnggaran.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null}, {null, null} }, new String [] { "Kode group", "Nama group" } ) { Class[] types = new Class [] { …

Software Development java java-netbeans java-swing
Member Avatar for Kusno
0
600
Member Avatar for buddha527

I was given this code by my professor [CODE] main.cpp #include "home.12.h" int main() { cout << mystery(30) << endl; return SUCCESS; } // end of main //========================================= functions.cpp #include "home.12.h" int search(int first, int last, int n){ int returnValue; cout << "Enter: first = " << first << " …

Software Development c++
Member Avatar for buddha527
0
117
Member Avatar for sanoski

OK everyone, this is probably gonna be a stupid question, so brace yourself. I'm brand new to all this. I'm really not having a literal problem, but it's driving me nuts because I don't know what it is. Forgive me if something like this has been discussed before. I just …

Software Development python
Member Avatar for ZZucker
0
117
Member Avatar for computer engW

Hi everone, Today i have a question has two parts and i did what i undrstood.If threr are mistakes ,please tell me. The Question is: [quote]father decided to buy a new vehicle. He paid 20,000 QR in cash and the rest will be paid on settlements as follows:  1500 …

Software Development c++
Member Avatar for Black Magic
0
107
Member Avatar for Nemoticchigga

Does anyone know the size of an enum? If i have [CODE]enum foo { YES, NO, MAYBE };[/CODE] is that 1 byte, but if i had 10 enumerations would that be 2 bytes, and so on? Thanks.

Software Development c++
Member Avatar for Narue
0
118
Member Avatar for amt_muk

Hi What are the basic differences between the methods atol() and strtol()? Regards, Amit

Software Development c++
Member Avatar for amt_muk
0
437
Member Avatar for godevars

I am very sure the code below can be simplified. The exercise was to take a word list, rearrange each word's letter to be in alpha order (e.g. barter = aberrt). The rearranged letter would be the keys and the word be be assigned to that key. Similar keys could …

Software Development perl
Member Avatar for trudge
0
136
Member Avatar for computer engW

Hi ; I know how to solve the same problem if i have limit numbers ,but here i have n intergers .How can the compiler understanst me when i need n integers ,like this question: [COLOR="Red"]Write a program that takes an n number of integers and calculates their average.[/COLOR] Using …

Software Development c++
Member Avatar for computer engW
0
95
Member Avatar for digital_ice7

why cant it work properly??? [CODE]#include <iostream> #include <fstream> #include <string> using namespace std; int main(){ ofstream out;//create output stream int acc_num[10]; for(int x=0;x<10;x++) acc_num[x] = rand()%10; //generate account number char acc_file[600]; for(int x=0;x<10;x++) acc_file[x] = acc_num[x] + '0'; out.open(acc_file, ios::out);//create & open output file out << "PACKAGE ID: "; …

Software Development c++ file-stream ios
Member Avatar for Nick Evan
0
107

The End.