43,549 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for death_oclock

I had forgotten about calloc for the longest time, but I was recently reminded of it. Now i'm curious, what would be the difference between [ICODE]malloc(numElems * elemSize);[/ICODE] and [ICODE]calloc(numElems, elemSize);[/ICODE]? If my knowledge of arrays is correct, there shouldn't be any difference in the memory allocated.

Software Development c
Member Avatar for death_oclock
0
137
Member Avatar for aminura

Well, today I had my C++ viva at my school..and I screwed it up!! The answers to this question which I was asked may be easy but I couldn't get it..Few questions of which I haven't got the answers yet-- 1. [CODE]class A { public: int a; int b; };[/CODE] …

Software Development c++
Member Avatar for charleen
0
295
Member Avatar for robotnixon

Quick question (hopefully). I have a vector of strings and need to remove duplicates. Normally, I'd just use sort, erase and unique. However, I don't want to sort the data. My idea was to copy the vector to a set, then back to a vector. But every attempt just screws …

Software Development c++
Member Avatar for robotnixon
0
553
Member Avatar for srikanth.cpd

i set my forms FormBorderStyle to None in vb.net i want to assign a border line in different colour which is not inside the form. how can i do it

Software Development vb.net
Member Avatar for sonia sardana
-1
169
Member Avatar for jacline

Add an interface, SizeComparable, that includes only the boolean isBiggerThan( Shape other) method. In your ShapeSet class, provide a method void sort(), that sorts the shapes of the shape set by class Shape implementing the SizeComparable interface. This is the problem I wrote codes but it gives run-time error.Could you …

Software Development java
Member Avatar for jacline
0
212
Member Avatar for Lilal

Heya, Just trying to get a little help on some excercises I need to do, Done 14/15 fine, but stuck on 15th and not sure quite whats wrong. Need to do a systemcall from C program to copy a file, using stat, open, read write and close. So far I've …

Software Development c file-system
Member Avatar for Lilal
0
99
Member Avatar for apch01

cant display the correct value of the structured values with function ... is it got to do wif some buffer stuff ??? [code] #include "stdafx.h" #include <iostream> #include <iomanip> using namespace std; const int MAXCHARS = 15; const int NUMEMPS = 1; int i; struct EmpRec { long num; char …

Software Development c++ ios
Member Avatar for apch01
0
70
Member Avatar for daviddoria

If I use the uncommented 3 lines for getting an int out of a stringstream, the value in MPV is wrong. However, if I make a new stringstream, then it works fine. I thought setting .str("") was essentially resetting the stringstream? [code] line = ""; getline(fin, line); //get fourth line …

Software Development c++
Member Avatar for daviddoria
0
470
Member Avatar for disc

When checking my code with PC-LINT it advised me to make some member-functions const What is the advantage of doing this ?

Software Development c++
Member Avatar for disc
0
183
Member Avatar for Samran

Hi, I am facing a problem with allocation of two dimensional char array. The problem statement requires me to get the number of rows and columns of the array from a file. I have saved the rows in "rows" and columns in "columns", both of type int. Here is how …

Software Development c++
Member Avatar for Samran
0
3K
Member Avatar for daviddoria

I have a delete button which does this: [code] TTDataSet.PunchEventTable.Rows(dgvData.SelectedRows(0).Index).Delete() [/code] The problem is that if I delete row 0 (the 0th index in the DataGridView and in the underlying table, all is well. But now row 1 in the table corresponds to row 0 in the DataGridView, so if …

Software Development vb.net
Member Avatar for rapture
0
895
Member Avatar for kamae

Hallo guys, it is me again. I need help how to create a simple backup file by just copying a file to another folder. Look at my code. [ICODE]Private Sub mnuBackup_Click() Dim SourceFile, DestinationFile As String On Error GoTo FileCopyFailed SourceFile = "D:\MyWorks\data\facility.mdb" DestinationFile = "D:\MyWorks\backup\facility.mdb" [COLOR="Red"]FileCopy SourceFile, DestinationFile[/COLOR] MsgBox …

Software Development visual-basic
Member Avatar for vb5prgrmr
0
97
Member Avatar for blair.mayston

Hi, Have adapted some code I found on the net to get a rss feed from a news site. I would like to email the output of this script using smtplib - after a couple of frustrating hours I have got that working as a separate element with my gmail …

Software Development python xml
Member Avatar for blair.mayston
0
111
Member Avatar for vmarc29

Hi all, i made some java few time ago and i'm now studying C++ here is a simple program i've been working on to learn about it but the fact is for some days now i can't figure why it doesn't work... in fact i just want to create an …

Software Development c++
Member Avatar for vmarc29
0
167
Member Avatar for nosnibor

[CODE=cplusplus] bool BODYTYPE::Seek(BODYTYPE * body) { string line; string key(body->style); size_t found = ' '; fstream file("..\\Data\\BODYTYPE.txt",ios::in); if (!file.is_open()) { cout << "Unable to open file \n"; return false; } file.clear(); file.seekg(0); for(;getline(file,line);) { if((found = line.find(key,0)) == 0 ) { file >> body->style >> body->doorCount; return true; } } …

Software Development c++ file-system ios
Member Avatar for nosnibor
0
87
Member Avatar for ryan311

it is possible? if the user in the running time, click the close button or the X button that we can see in the top of the form and then if the user click the close or X button message box will appear "you cannot log out"? how can i …

Software Development visual-basic
Member Avatar for vb5prgrmr
0
117
Member Avatar for Dendei

Hello i have an array of dates and want to input a week ex week #14 and get all the dates written out in that week. Anyone know a good way to convert weeks to dates or how i should solve this? thx for answer.

Software Development c++
Member Avatar for Dendei
0
96
Member Avatar for Vallnerik25

I have a question regarding when to use delete to free memory used by a pointer. I have a class function that uses dynamically allocated memory and I want to properly use delete to free up the space when I am done with it. [code=c++] // Overloaded addition operator. CSimpleString …

Software Development c++
Member Avatar for Vallnerik25
0
243
Member Avatar for Bands

Hi, i'm trying to create a vb.net calcualtor similar to that of windows but with more functions, the problem is that i can't think of how i can use a single text box to get the two input numbers. i've tried using .visible but still does not work.

Software Development vb.net
Member Avatar for c0deFr3aK
0
284
Member Avatar for srikanth.cpd

Iam creating an application. i have a main form it has 5 buttons i have created 5 more forms. my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be …

Software Development vb.net
Member Avatar for srikanth.cpd
0
105
Member Avatar for dvsConcept

I'm trying to simulate the spin of a slot machines [reel1][reel2][reel3] so they look like they are in motion. i'm getting this error: Error 2 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion) [code=c++] //rotation of …

Software Development c++
Member Avatar for dvsConcept
0
701
Member Avatar for ksanthoshmail

error in open exe application in vb.net Please Help me: While open exe in my vb.net Project i got a error your were middle of somthing it.... and it throws invalid operation exception. My code: Dim strexe As System.Diagnostics.Process If strexe IsNot Nothing AndAlso Not strexe.HasExited Then strexe.Kill() Else Dim …

Software Development vb.net
Member Avatar for ksanthoshmail
0
174
Member Avatar for cljlxwater

if i define a array, for example private int[] lendMoney = new int[10]; do i can use a use property to match this private array? thank you

Software Development
Member Avatar for Rashakil Fol
0
112
Member Avatar for jaasaria

hi guyzz im using crystal report for my application... i have problem in making formula in details parts of my report.. i access two tables in making the details, but my problem is to display the amount by subtracting or adding the details amount.(for getting the running balance.) plss see …

Software Development visual-basic
Member Avatar for jaasaria
0
135
Member Avatar for VBNick

right now, I am allocating a dynamic 2D array for my rasterizer's edge list. My setup looks like this: [code="cplusplus"] struct EDGE { float x, dx; float uvws[4]; //u, v, 1/z, shade float duvws[4]; float y_limit[2]; bool active; }; struct EDGERECORD { EDGE *left_edge; EDGE *right_edge; EDGE edges[9]; UINT16 num_edges; …

Software Development c++
Member Avatar for VBNick
0
140
Member Avatar for pythononmac

name = caffé print name Python gave me an error on print: ascii' codec can't encode character u'\xe9' in position 5: ordinal not in range(128)

Software Development python
Member Avatar for pythononmac
0
684
Member Avatar for BruenorBH

I am creating a program in Dev-C++ v. 4.9.9.2 using Win32 API that loads from a file and saves to a string. The only issue is that I cannot split the string to the requested variables... Here is what is in the file... 08:00:00 PM, 08:00:00 PM, 08:00:00 PM, 08:00:00 …

Software Development api c++
Member Avatar for BruenorBH
0
114
Member Avatar for c0dex

Hey all, for quite some time I've been working on an inventory management program for work, and I'm having a bit of an issue with the rendering of a JFrame notification window, I'll do my best to explain below (including screenshots). So my program works with a remote FTP server …

Software Development java java-swing perl visual-basic
Member Avatar for JamesCherrill
0
204
Member Avatar for freddan007

Hello, I've started learning how to make simple GUI programs in cpp using theforgers tutorial. However I was going to add XP style to my program and I found a page that showed me exacly how to do it for VC++ 6. The problem when I had added the lines …

Software Development c++ file-system gui
Member Avatar for freddan007
0
763
Member Avatar for ahfrey85

Hi, while doing my assignment im somehow stucked somewhere which i didnt know why and i need some help. i have jus started learning abt c++. so im jus using some basic syntax [code] #include<iostream> using namespace std; int main() { int selclass,i,position; char ch; int seats[100]={0}; //array while(true) { …

Software Development c++
Member Avatar for ahfrey85
0
125
Member Avatar for erialclaire_238

Newbie here. i need to create a program with this output: Enter 5 values: 3 4 5 7 9 Enter a number to search: 4 4 found in location 2 Anyone who can help me on this? Tnx, Claire

Software Development c++
Member Avatar for skatamatic
-1
98
Member Avatar for bluemm87

I'm trying to learn C++ with a book and it has this example program in it, but when i try to compile it, it comes back with error C2065: 'localVarable' : undeclared identifier. What's wrong with it? [code=cplusplus] // allocating and // deleting a pointer #include <iostream> int main() { …

Software Development c++
Member Avatar for bluemm87
0
76
Member Avatar for charlie81

I think i have everything write except for the Input statements. It is telling me that JOptionPane can't be resolved. Here is what I have so far. public class Main_Class { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String firstNumber; String …

Software Development java
Member Avatar for charlie81
0
193
Member Avatar for serkan sendur

hi guys, i wonder if there is technically any difference between using break or return in order to quit a loop without reaching its condition?

Software Development c++
Member Avatar for Narue
0
1K
Member Avatar for dev_kc

I am not able to create object for word doc,this is the code i wrote,the object sets to nothing,when i run the code If blnChkFirst = False Then Set owordapp = CreateObject("Word.Applicatiion") Else Set owordapp = GetObject(, "Word.Applicatiion") If Err.Number <> 0 Then Set [COLOR="Red"]owordapp[/COLOR] = CreateObject("Word.Applicatiion") owordapp.Visible = True …

Software Development visual-basic
Member Avatar for cguan_77
0
87
Member Avatar for Q8iEnG

Hi guys.. I don't know if this is the right forum for my question, but.. I have a question from 13 questions I solved them all, and I just got stuck on this one "4. Consider the following advances. Decide whether each of them attack the essence or the accidental …

Software Development java
Member Avatar for Q8iEnG
0
170
Member Avatar for foxypj

I am currently working on a project where i need check whether a date that is inputted is valid. i know how to use this using repetitive if functions. for example; to check the month you do if (month <1 || month >12) Then to check the day which is …

Software Development
Member Avatar for foxypj
0
150
Member Avatar for kinsey

Hi, I need some help with a C++ assignment. I'm supposed to write a Hangman program that will: The user should be able to choose between playing against the computer, or against another human. The only difference will be how the word to be guessed is selected: If playing against …

Software Development c++
Member Avatar for vivekc++
0
867
Member Avatar for jascase901

Hello i Just learned about the Exec statement, so i trying to make a flash card program that saves your cards. The way that i wanna keep the cards persistent is to save a dictionary to a text file and then just use the exec statement to call forth the …

Software Development file-system flash python
Member Avatar for jascase901
0
1K
Member Avatar for DemonGal711

I'm writing the class for the N-ary tree and I need to finish it with a destructor. For my tree, all I do is insert, traverse, print, and destruct it basically. The part of the code dealing with it will be something like: [code]while (/*not at end of input*/) { …

Software Development c++
Member Avatar for DemonGal711
0
310
Member Avatar for redhotspike

Ok, so I am befuddled. Each individual file compile fine, no errors. When I compile all together and create an executable, no errors. But, when I run the program, I am getting an error. I have it narrowed down to a problem with my [icode]void LinkedList::insert(const ElementType &dataValue)[/icode] but I …

Software Development c++ linked-list web-design
Member Avatar for redhotspike
0
184
Member Avatar for rasingh24

I have this Xml file that i browse from my HDD into my C# program. Now the nodes of this Xml doc get displayed in a tree view in my winform.All my logic is in the winform right now. There are three methods 1. To load the Xml doc in …

Software Development file-system xml
Member Avatar for dickersonka
0
99
Member Avatar for leothe3

I've been trying to solve this problem for a few hours now. I'm new to Python but I have programming experience in other languages. Description of my problem: 1) I'm writing a script that will run as a cron job to verify if data transfer is occurring on some legacy …

Software Development python
Member Avatar for leothe3
0
1K
Member Avatar for venomocity

Alright my family of geniuses here is my new dilemma. In a card game I have created via VB6 I thought it would be great to spiff it up with music during game play. The problem however is I have no idea where to begin. I have read some posts …

Software Development visual-basic
Member Avatar for venomocity
0
170
Member Avatar for ctrl-alt-del

Hi all, I've been working with C# for some time now, even created a Mastermind-game yesterday to learn some stuff (Mastermind is a very nice training project by the way, I really had fun coming up with solutions) But while that I ran across a problem that I haven't been …

Software Development microsoft-access visual-studio
Member Avatar for ctrl-alt-del
0
172
Member Avatar for Norbert X

Okay I don't get this problem at all: [code=python]import random def chance(number): number = input for each in xrange(number): n = random.randrange(100)+1 return n def extreme(x): z = x + 5 y = z - 3 return z, y #main repeat = 0 while repeat != 2: x = input("Enter …

Software Development python
Member Avatar for jlm699
0
149
Member Avatar for katamole

I'm currently doing a projecteuler problem, which requires finding the sum of all the primes below two million. I have a primitive function which determines whether or not a number is prime. This function is incorporated into the below function to produce a list with all the primes below the …

Software Development python
Member Avatar for MK12
0
168
Member Avatar for Mossiah

[code=cplusplus] // New2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <iomanip> #include <string> using namespace std; void reverse(string& s); int _tmain(int argc, _TCHAR* argv[]) { string st="Word" ; cout<<st<<"\n"; reverse(st); cout<<st<<"\n"; return 0; } void reverse(string& st) { int i; int j …

Software Development c++
Member Avatar for iamthwee
0
166
Member Avatar for kamae

I need help in using "[COLOR="red"]between[/COLOR]" sql function. I don't know how to use it. I am comparing two time using [COLOR="red"]dtpicker[/COLOR]. The time should only be acceptable if I input between 6:00am and 6:00pm like 7am, 8am,.........6:00pm. 5am below and 7pm above are not acceptable. In need help. . …

Software Development sql visual-basic
Member Avatar for kamae
0
95
Member Avatar for tux4life

Hello, My problem is that the program always gives the same output: [CODE]There were no matching numbers !!![/CODE] The source of my program looks as follows: [CODE=cplusplus] #include <iostream> using namespace std; int main(void) { const int MAX_CHARS = 500; const int MAX_NUMS = 5; const int MAX_NUM_CHARS = 25; …

Software Development c++
Member Avatar for tux4life
0
137

The End.