43,549 Solved Topics
Remove Filter ![]() | |
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 | |
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++ | |
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 | |
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 … | |
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 | |
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++ | |
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++ | |
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 … | |
[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 … | |
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 | |
Can all for statements be written as while statement. Vice Versa? Software Development c++ | |
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 | |
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 | |
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 | |
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... | |
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++ | |
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 | |
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++ | |
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 | |
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++ | |
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 … | |
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 … | |
//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' && … | |
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++ | |
: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++ | |
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 | |
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 | |
Is there a way to cast a the contents of a char* buffer into an int? Software Development c++ | |
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 | |
[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 | |
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++ | |
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++ | |
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 | |
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++ | |
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 | |
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 | |
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 | |
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++ | |
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: ' … | |
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 | |
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 | |
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++ | |
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 | |
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++ | |
Hi What are the basic differences between the methods atol() and strtol()? Regards, Amit Software Development c++ | |
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 | |
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++ | |
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 |
The End.