28 Archived Topics

Remove Filter
Member Avatar for Agni

Hi, i have seen a lot of ppl say things like, 'this piece of code is more efficient than the other', 'this gives better performance' or 'more efficient memory wise' etc.. but i fail to understand that how in a normal coding scenario can i find out the efficiency of …

Member Avatar for Magee_1
0
3K
Member Avatar for Agni

I have a some libraries which have a lot of common classes but the namespaces are different. Most of the code I was writing could be easily reused by classes in both libraries so after some reading I tried a technique of using the templates to pass namespace. As you …

Member Avatar for Agni
0
126
Member Avatar for Agni

I have been reading the 'inside the c++ object model' by Lippman and one of the sections has me a little confused. It is the section where the author explains how virtual tables are created and virtual pointers assigned, in the scenario of multilevel, single inheritance. If anyone here has …

Member Avatar for Agni
0
327
Member Avatar for Agni

Hi, I'm using istream_iterator to read input from standard i/p and writing it to standard o/p using ostream_iterator. I expected it to print the input to the console when I hit enter and then exit but it loops for next input after printing and so on. [code=c++] #include <iostream> #include …

Member Avatar for Agni
0
202
Member Avatar for Agni

Hi, I have always been a little confused about inline/non-inline virtual functions and got a little more confused when I read this in a book: According to the book the code below will fail to link on many systems(it gave no errors on mine, g++ 4.4.1). The explanation is "Even …

Member Avatar for mrnutty
0
653
Member Avatar for Agni

[code=c++] int main() { int i=10; char arr[i]; } [/code] I was expecting an error but it is compiling without any issues. I'm assuming the g++ compiler is doing something but not sure how to disable that. This is my compiler info [quote] Using built-in specs. Target: i486-linux-gnu Configured with: …

Member Avatar for Agni
0
139
Member Avatar for Agni

[code=c++] class A: public B { C* p1; C* p2; } [/code] What would be a correct assignment operator for class A? We have to ensure that we do not leave any object in an inconsistent state due to any exceptions or create any dangling references or memory leaks.

Member Avatar for Dave Sinkula
0
153
Member Avatar for Agni

hey guys, I have a fixed length .txt file. Values in the file correspond to columns in a db table. ex file row is something like: [B]India 3455 78787 89898[/B] table has columns something like: [B]column_name length startPosn EndPosn[/B] country 6 1 6 ID 6 7 13 so you see …

Member Avatar for tux4life
0
458
Member Avatar for Agni

Hi Guys, I'm trying to create my own DBMS. For now i want to create a simple one where i can 'create' tables, 'insert' data and do a 'select' for all values(no where condition as of now). Very basic features. This is the first design/pseudo code that i have come …

Member Avatar for ddanbe
0
125
Member Avatar for Agni

This code here is giving segmentation fault. Any clues why? also any general tips for writing good multi-threaded code are welcome. [code=c++] #include <windows.h> #include <process.h> #include <iostream> using namespace std; unsigned __stdcall Display(void* p) { Sleep(500); cout << "Display" << endl; cout << *((int*)p) << endl; return 0; } …

Member Avatar for Salem
0
192
Member Avatar for Agni

Hi guys.. I'm facing a problem in my project. Basically its a small project for a retail store inbound section. The goods come in cartons and the user enters the carton ID in the UI to accept the carton. In the backend the carton details get updated in the table …

Member Avatar for Agni
0
91
Member Avatar for Agni

i posted this in geeks lounge, got no response, so posting it here... Hi Guys... Anyone can share which are the top universities in UK for a Masters in Software Engineering and related fields? And how are they, compared to the top Univs in US and Canada?

Member Avatar for jbennet
0
160
Member Avatar for Agni

Hi, The same code as my previous post, but because of this list thing, i'm not able to run specific commands for different options. Here i have 2 options under the 'Names' Menu, 'rajat','prasun', now when the user selects either of them i should be able to know which one …

Member Avatar for Agni
0
99
Member Avatar for Agni

Hi, Below is my test code, i have a list of names in a file, i read the names and i have to insert them as menu options in the menubar. Since its a dynamic menu and people can add new menu's it has to be read from a file …

Member Avatar for Agni
0
242
Member Avatar for Agni

Hi Guys, i just wrote a program to print a sentence backwards using recursion. But i'm not too happy about it, if someone can give me a more optimized solution i'll be glad. You have to use std::string class. input: where the streets have no name output: name no have …

Member Avatar for Agni
0
348
Member Avatar for Agni

Hi Guys.. I need to know how to debug the 'main' of an exe using dbx. i cant put a 'sleep' and recompile it. For example in windows using visual .Net i can do something like >devenv /debugexe xyz.exe This will bring up the exe in debugmode. i need the …

Member Avatar for Agni
0
124
Member Avatar for Agni

Hi Guys... i'm sure the topic has given you a braod hint and if u've still been brave enough to open this just help me out... i have a dual boot system, windows XP and Ubuntu 7.1. i need to change this setup to a virtual machine setup, host xp …

Member Avatar for taramichael
0
140
Member Avatar for Agni

[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; } …

Member Avatar for ash05
0
161
Member Avatar for Agni

Hi, I have 2 modules, grepforapp.py and myApp.py. Basically i'm trying to make a 'search' utility. myApp makes the UI with one textbox for taking input, start button and a list box which displays the file names where the pattern was found. grepforApp walks through the dir tree and searches …

Member Avatar for woooee
0
197
Member Avatar for Agni

Hi Guys.. Can someone explain to me what's the difference between sending any data over a socket vs sending an http request? i mean sending an http request would also be happening over a TCP socket, am i right? so basically it's as simple as sending data from client socket …

Member Avatar for tzushky
0
714
Member Avatar for Agni

Hi, When i search for a pattern in a file how do i get the line and line#? basically i want to replicate the 'grep' command functionality. Now i can easily say whether the pattern exists or not using re.search funtion but i'm not able to print that particular line …

Member Avatar for Agni
0
125
Member Avatar for Agni

Hi, We're using curses library functions to draw windows in our project. For showing an error the error message is enclosed within '-'s , it seems to be working fine till we ported to a new linux machine where its displaying some garbage instead of the '-' . To be …

Member Avatar for Duoas
0
117
Member Avatar for Agni

Hi Guys... i'm not so good at oracle, sql and related stuff.. but i do need to write some simple query's from time to time and i do need to understand that which all tables get updated by a particular transaction. I can do that by going through the code, …

Member Avatar for alit2002
0
96
Member Avatar for Agni

Hi.. whats the best way to initialize a char* ? i tried using char* p = ""; and it gives segmentation fault at times. not sure how to initialize it. this is the function where i'm using it. screenReturnValue variable is not getting initialised properly everytime, when i call this …

Member Avatar for Agni
0
15K
Member Avatar for Agni

[quote]Reposting from another forum as i didnt get many suggestions there[/quote] Hi Guys, In my project the user will enter the name of the organization and it's floor map has to be displayed. the maps have to be made by us and need not be complicated at all. what i …

Member Avatar for ithelp
0
201
Member Avatar for Agni

hi, I have a XML in a String coming from an external input. The problem is that this string is getting some junk characters appended to in the last. I need to find the lenght of the string only till the correct part. once i get this lenght i can …

Member Avatar for Agni
0
187
Member Avatar for Agni

I have a vector of a structure.. say [QUOTE]struct employee { string name; int age; int empId; }; and a vector of this structure RWTValOrderedVector<employee> vec;[/QUOTE] suppose this vector has 4 entries. Now if i want to find in this vector for employee information of a specific employeeid, how do …

Member Avatar for DangerDev
0
123
Member Avatar for Agni

Guys i have a design where in i have 6 classes called 1)HttpServer 2)ParserClass 3)InputInterface 4)Cartonization 5)OutputInterface and then i have a 6)Manager class. HttpServer gets the request xml as a string in request body. ParserClass parses the string xml and stores value in variables. inputInterface inserts the values in …

Member Avatar for ithelp
0
101

The End.