43,549 Solved Topics
Remove Filter ![]() | |
Is there a difference, in terms of performance, between the two loops below? (myvec is type [icode]std::vector<int>[/icode].) [CODE]std::vector<int>::const_iterator pos; for (int i = 0; i < N; i++) { pos = myvec.begin(); // do something with pos }[/CODE] [CODE]for (int i = 0; i < N; i++) { std::vector<int>::const_iterator pos … Software Development c++ | |
I started this hangman game as a suggestion for beginners but now I am stuck. The code runs with out any errors but I need some way to put a certain amount of turns that the user can have but I am not sure how I could add this to … Software Development python | |
I'm trying to get my hands around Forms Painting in Visual C++, so I've created a Form, and on that Form I have added a Panel called cityPanel. I'd like to paint a green rectangle on it. I double clicked cityPanel, which resulted in Visual C++ creating this new function: … Software Development c++ | |
Hello, I am wondering if it's possible to hide/show components on a form, depending on which radio button is selected. For example lets say i have two radio buttons (in a buttongroup) and two buttons. When i select the first radio button i want the first button to show, and … Software Development java | |
I have a problem to understand what I am doing wrong with this code. I have the string Line123. What I want to do is to make the output of this string to look like: "Number1> Number2 Hello Number1> Number2" So what I did is to take all blancspaces away … Software Development c++ | |
Well i am a starter in programming and need ur help. M using older version of borland c++ for programming. M trying to make a program which adds users login and password information and also verifies the correct login and password by accessing the contents of those files. but there … | |
Hi, I am new to VB 2008 and am trying to add a tableadapter to my app. I get as far as creating the tableadapter but when I try to add a column to the table I get an error message TABLE DOES NOT EXIST. Thanks in advance, Bill P. Software Development vb.net | |
I am currently working on sending a file that contains one or more sentences through a parser, using command prompt. C:\ exe argument1 file is the format it must be sent it in command prompt The parser works and will return the parsed sentences in the command prompt ranging from … Software Development java | |
this is a done version of the previous thread. it concatenate all the arguments if they are not the same... however some case will make it a:a:b:a:b:c i try to change all the : into space and then uniq them out.... but the uniq is not working this way i … Software Development shell-scripting | |
Hi, I try to compare items in two different arrays. This loop works well in another program of mine. But not in the current program i'm working on. Weird.... The output of the program shows [ICODE] Nested quantifiers in regex; marked by <-- HERE........ [/ICODE] [CODE=PERL] for $3 (@obsolete_class_declare) { … | |
I have a header file causing me several errors. It contains a class definition, then I have a *.cpp file with the function definitions. Header: [CODE]#ifndef DOT_H #define DOT_H #include "SDL/SDL.h" #include <vector> class Dot { private: int x, y; int xVel, yVel; vector<SDL_Rect> box; bool check_collision( vector<SDL_Rect> &A, vector<SDL_Rect> … Software Development c++ visual-studio | |
Hi guys :) I'm just wondering how to start doing this problem? Converting from Infix notation to Postfix one (Pastfix Calculator) Of course in C++ using stack! Any Idea how to implement the code? thanks :) Software Development c++ | |
could someone show me how to read more then 1 line of text in a file and print it on the screen im kinda new at this tho i no how to do 1 line using namespace std; [CODE]int main() { system("COLOR 5"); system("TITLE tempature converter"); double dfirstNumber, danswer, firstNumber, … | |
Hey there everyone I need a little help. Right now I am in the process of writing a program that uses subscripts and superscript but I dont have a clue how to get them. I am not even sure if they can be used in python so if any of … Software Development python | |
im new with c++ and dont know much but want to save the answer to the program i made when i do it names the file ÿÿÿÿ also the type of file is just called file how can i make it like .txt or somthing also just ignore the useless … | |
I have Created a Form1. On this Form I have a button that opens Form2 like this: [code] Form2 ^form2 = gcnew Form2; form2->Show(); [/code] Now if I click on Form1, Form2 will "dissapear" under Form1. What I wonder is, if it is possible to click on Form1, but stil,l … Software Development c++ | |
i spent a long time trying to fix this probably somthing stupid but please help me. i dont see any problem but its probably somthing stupid. it compiles ok and when i run it it works until i get to the equations it prints somthing like 1.62111e-307 here is my … | |
[code=c++] #include <iostream> using namespace std; class Lock { friend class First; private: Lock() { } }; class First : virtual public Lock { public: void function() { cout << "function1" << endl; } }; class Second: public First { public: void function2() { cout << "function2" << endl; } … Software Development c++ | |
Just thought id post here while i search google at the same time because well two brains are better than one :) The Asc function converts the first letter in a string to ANSI code, and returns the result. Syntax Asc(string) Thats the VB version of it, i need something … Software Development c++ | |
[CODE]Linking... Main.obj : error LNK2001: unresolved external symbol "int __cdecl ConvertANSI(char)" (?ConvertANSI@@YAHD@Z) Debug/szStub.exe : fatal error LNK1120: 1 unresolved externals[/CODE] Defined: [CODE]#include <windows.h> #include <math.h> #include <iostream> using namespace std; int ConvertANSI(char sChar); [/CODE] Function: [CODE]// Credits to Dave int ConvertANSI(char szText[]) { return static_cast<int>(szText[0]); }[/CODE] Usage: [code] if(ConvertANSI(szChar) >= … Software Development c++ | |
I completely rewrote the Stub i was writing because my VB -> C++ was shocking. VB Version: [code=vb] Public Function TempPath() As String Dim WindirS As String * 255 Dim TEMP TEMP = GetTempPath(255, WindirS) TempPath = Left(WindirS, TEMP) End Function [/code] The Left function returns a specified number of … Software Development c++ visual-studio | |
Hi, I am trying to use a 2D array to gather information from a dialogue box. The array has been publicly dimensioned in a module. Before the dialogue box is opened, there is data in the array, and thats fine, but as soon as soon as the dialogue box is … Software Development vb.net | |
Hi. Objective: Write a program that declares a 12*12 array of characters. Place Xs in every other element. Use a pointer to the array to print the values to the screen in a grid format. Listed below is my non-functional attempt. Any help would be most appreciated. Thanks, Molly [CODE=C] … Software Development c objective-c | |
Hi, I set DataGrid1 column width as follows, but it doesn't effect when i run my program. [code] DataGrid1.Columns(0).Width = 3030.236 DataGrid1.Columns(1).Width = 1604.976 DataGrid1.Columns(2).Width = 1904.882 DataGrid1.Columns(3).Width = 1065.26 [/code] Thanks Software Development visual-basic | |
I try to simply concat the arguments if they are not the same..... what is wrong with this simple code for concat??? [CODE] #!/bin/sh result=$1 shift while [ "$#" -ne "0" ] do next=$1 if [ $result = $next ] then : else $result="$result $next" fi shift done echo "$result"[/CODE] … Software Development shell-scripting | |
Please help with the following linked list program. Any help is good =] Use a linked list to do this program a store recieves shipmesnts of chairs at various cost. the store policy is to charge a 35% markup, and to sell chairs which were received earlier before chairs that … Software Development c++ linked-list promotion | |
Does anybody know how to this question.... An election is contested by 5 candidates.They are numbered 1-5 and the voting is done by marking the candidate no on the ballot paper. Writea program to read the ballots and count the votes cast for each candidate using an array variable count.In … Software Development c++ | |
My program currently takes three inputs from the user ( Wage, Hours, Tips ), then it calculates the gross income. Im brushing up on my c++ and Im not sure what functions I need to look for, but I know what I want to do. 1. I would like to … Software Development c++ | |
I started trying to teach myself how to program in python just a few days ago. I have been using a wikibook for non programmers and it has this piece of code as an example. I CAN NOT for the life of me figure out why it outputs the value … Software Development python | |
Hi everyone, I have a problem to insert text into a text widget in Tkinter. I want to be able that each time some text is inserted (by means of an action -not directly by the user-) that text is displayed into a new line. However I can't figure out … | |
Hi I have been writing VB.Net for a few weeks, it has been going well but I am now stuck. I have multiple user controls on a form and I need a way to remove a selected one. I was hoping that something like this would do it [code] Private … Software Development vb.net | |
Hello, The following code works but I am having trouble formatting it with setw() and I am not sure if it possible to format it with a space so that the entire seat header fits on one line and for the rows to also fit on one line with spaces. … Software Development c++ | |
String functions like strcpy,strcat,itoa...shows warning as "declared deprecated" in Visual Studio 8.0 instead it suggests to use functions which are enhanced secure versions of the same such as strcpy_s,strcat_s,_itoa_s.....using this in my file removes those warnings but i am using this same file in visual studio 6.0 here it gives … Software Development c++ visual-studio | |
I am started a new with VB6 Access project. I am connected database with ADODB, DSN Method that Code Given below. '======================In module ============== '=================== Connection With Database =============== '====================================================== Public CNN As New ADODB.Connection Public RS As New ADODB.Recordset Public cString As String Public Sub Main() Set CNN = … Software Development microsoft-access open-source visual-basic | |
First off i would like to say i am very new to vb, i am using vb 2008 express edition and while making a web browser (which is supposed to be one of the easiest things to do), i decided to some image links to some of my favorite sites, … Software Development vb.net web-browser | |
Help I am having the following error: error C2446: '==' : no conversion from 'int' to 'char *' When I tried the following it ignores my counter and I am not sure why. This is a serious problem because it creates and infinite loop that keeps printing. [code] if(char(seating[openSeat + … Software Development c++ | |
Please help – I am having either some logic issues or formatting issues: My code is the following: [code] #include <iostream> using std::cout; using std::cin; using std::endl; #include <iomanip> using std::setw; using std::setprecision; #include <cstdlib> // contains prototypes for functions srand and rand using std::rand; using std::srand; #include <ctime> // … Software Development c++ | |
The default copy constructor should work for the Polynomial class below because it does not contain any dynamic data types. However, when I create a new Polynomial via the copy constructor, it prints 0 for the value of each coefficient. How can I fix this? [CODE]#include <iostream> #include <vector> class … Software Development c++ | |
Hey. What's better, i++ or ++i? Well ++i returns the value after it's incremented, but which is faster? (not necessarily for int, user-defined types with operator++ overloaded too.) Software Development c++ | |
hello pals, I need a help with using re module to search and convert uppercase words in a string to title case Eg: [code] mystr='Hello everybody. Some times THERE ARE upper case words' #Results should be 'Hello everybody. Some times There Are upper case words' [/code] Hope you can give … | |
Hello, i'm attempting to create a splash screen using the code snippet posted on this site(i.e. DaniWeb) - [URL="http://www.daniweb.com/code/snippet697.html"]http://http://www.daniweb.com/code/snippet697.html[/URL] However, I'm having some difficulty. It appears that the splash screen will continue to run w/out disposing itself. That is, the screen hangs and does not go away. Also, the screen … Software Development java | |
I'm trying to update/refresh my data grid but it doesn't seem to update whenever there's a new entry. I've search the net about it and they were talking about databind(). I can't seem to have that in my datagrid. My intellisense only shows DataBindings not databind(). here's my code (when … Software Development | |
hi , i have a simple problem here, that is how can i convert an Decimal integer into Hexadecimal integer and not in Hexadecimal string. I have wrote the following code and managed to get the output from the program. But for a certain reason i cant use it again … Software Development java | |
i think it is not possible to print vertical lines along with text data in vb6..so i thot of transferring the whole contents from vb form to a word document. but now i dont know how to do that. i want to transfer the data in a specific tabular format. … Software Development visual-basic | |
Hi, I have a subroutine(callMe) in Module1. I want to call "callMe" in other subroutine in Form1. I cant do it. I cant call subroutine in other subroutine. How do i do it. Thanks Software Development visual-basic | |
Hi I'm a python beginner! I'm trying to make a list of 3 numbers per line but I get an error. =( Here's my code: [CODE=python]list2 = [23, 764, 12, 54, 83, 2, 543, 890, 1235, 453, 98] k = 0 while list2[k] != -1: first = str(list2[k]) k = … Software Development python | |
Is it possible to store * and # in an array? I thought I could do this through the data type char. On top of that I was wondering if I could check the array elements to see if the element equaled that character, but I don't think that's possible. … Software Development c++ | |
Hi all, I've developed a vb.net application for a desktop digital clock and deployed it. I made the application start at windows startup and it's working fine. But the taskbar button for the application is there in the taskbar every time the windows login. Please help me to modify the … Software Development vb.net | |
Hello, I'm embarrassed for asking this question but for the life of me I cannot find an answer. This ultra simple code is giving this error as well as any other function that I'm trying to write. [CODE]a function-definition is not allowed here before '{' token expected `,' or `;' … Software Development c++ | |
Hey all I recently picked up the book "Java the first semester". It uses the EasyIn class to get user input. I have downloaded the file EasyIn.java but I dont know how to make the class accessible from my programs. [QUOTE]As long as the EasyIn class is accessible you can … Software Development java |
The End.