About Experts Sitemap - Group 8 - Page 4 2013-05-21

C++: How to use type discrimination?, c overloading, value template
c overloading, value template, virtual value: Ah! Well I was only speculating in my answer and had not thought out any specific scheme for the situation specific to the questioner. However the basic idea is simple and is the sort of thing used with discriminated unions. For example here is a simple Any...

C++: How to use write() function with float values ?, type conversion, file in c
type conversion, file in c, strig: Hi dear Naveen ! Nothing sounds serious with this program , just take a look at the prototype of the write function write (int handle , void* buffer , unsigned len); make sure that the second argument should points the buffer where the function...

C++: user defined header files, declaration syntax, syntax error
declaration syntax, syntax error, int main: # include iostream using namespace std; #include header.h int main () { using namespace compare; cout x endl; cout add (x,x) endl; return 0; } =================================== namespace compare { int x = 5; int add...

C++: How to make user interface in C++, user interface
user interface: Hello Zaheer, thank you for the question. Unfortunately, without more information, there is no way I can help you. What error are you getting? What is causing it? What are you attempting to do in your application? If you could fill me in better I...

C++: using an array for brute combinatorics/permutations, free compilers, int array
free compilers, int array, mono wav: OK, I am still not 100% certain I have understood exactly what you are trying to do and what you are having a problem with but as far as I can tell: 1/ From the point of view of what you are stuck with the audio is a bit of a red herring. 2/ What you...

C++: using DLL in C, dynamic link library, dll in c
dynamic link library, dll in c, c program: Hello trung, thanks for the question. I was wondering if you could maybe be a little bit m ore specific in regards to your question. What do you mean by reference a DLL ? If you could be a little bit more specific in what you want to do with this DLL or...

C++: using DLL in C, dynamic link library, external linkage
dynamic link library, external linkage, dll in c: Dear Trug, Thankyou for your question, i hope this will help you clarifying your concept. a DLL is simply a set of compiled programs (just like a .obj that is created by your compiler). So, you can link the DLLs with any of your projects, the...

C++: using DLL, dynamic link library, win32 api functions
dynamic link library, win32 api functions, microsoft linker: Oddly this is not a C++ or even a C question! It is a platform specific question. In this case I presume you are using a Microsoft operating system as you talk of DLLs and EXEs. First, functions that can be called from a dynamic link library have to be...

C++: using fout, free beta version, leap year
free beta version, leap year, cout: Hello eileen, thank you for the question. I compiled and ran your code with Visual C++ 2003. Aside from being stuck in an infinite while loop (the while(true) doesn t have a terminating condition), the output in the file was fine. Could you please give...

C++: using VC project as Com/ActiveX aplication, david spector, c programming language
david spector, c programming language, msdn library: regdars, Thank you for your question. I regret that I do not own .NET (it is very expensive), so I cannot answer questions about it. Please feel free to submit questions specifically about the C++ programming language to me at any time. You can search...

C++: Validate user input and pause display, mortgage interest rate, double conversion
mortgage interest rate, double conversion, mortgage term: Here is your complete program. Validation in user input is much simpler ! Just get the input in a charecter array 2. Convert the input value into float using atof() function. 3. If its a valid input the function return float value. else it will...

C++: VC++, visual c 6, david spector
visual c 6, david spector, purpose programming: Ali, Thank you for your question. Unfortunately, you have not given enough information for me to be able to answer your question. Please resubmit your question with more details or a clearer description and I will do my best to answer. Image processing...

C++: VC++, visual c 6, david spector
visual c 6, david spector, visual basic 6: mojtaba parsa, Thank you for your question. Unfortunately, you have not given enough information for me to be able to answer your question. Please resubmit your question with more details or a clearer description and I will do my best to answer. I am...

C++: VC++, mfc application, pain in the neck
mfc application, pain in the neck, google: Hello szada, thank you for the question. I would start out first by going to http://msdn.microsoft.com and searching through the MFC functions and the processes of creating an MFC application. I m assuming you re going to use MFC because it is specifically...

C++: VC++ dll, borland compilers, david spector
borland compilers, david spector, compilers support: alshikh, DLLs are used the same way no matter what development tools or compilers are used. There are two major ways to use DLLs. 1. Automatic loading: When a DLL is compiled and linked, an excuteable .dll file and a description .lib file are generated....

C++: VC++, david spector, depth answers
david spector, depth answers, debugging: Anjaneyulu , Thank you for your question. I regret that I am unable to give in-depth answers to nonspecific questions such as this one due to the volume of questions received. Please feel free to ask specific questions and I will endeavor to answer....

C++: Verification of Algorithms, hello eddie, factorials
hello eddie, factorials, handy tool: Hello Jed, thank you for the question. What I tend to do is write extensive unit tests for methods like this that test a range of values with a range of outputs. There is a handy tool called CppUnit to help with that. For instance, if you wrote a method...

C++: Virtual Function, class member function, virtual member
class member function, virtual member, virtual function: In the code you showed in your question no member function produces output in float so it is not surprising that this is not output. I suspect however that you were expecting in double and in float was a typo or that the code either that you were...

C++: Virtual functions, function pointers, void print
function pointers, void print, virtual functions: Hello Meghaldevi, thank you for the question. A virtual function is a C++ function that is bound to an invoking object at run time and implicitly called correctly. Here is an example: class A { public: A(); ~A(); virtual void print() {std::cout...

C++: Visual C++ 6: Calling a function in a C program., c source files, visual c 6
c source files, visual c 6, david spector: Rohit, 1. You cannot redefine a function argument list as you have indicated. You must supply the called function with the data in whatever way the called function expects it. The HASH function is declared in the Include file that comes with your library....

C++: Visual C++ or C++?, core language features, computer programming language
core language features, computer programming language, sql server express: Basically yes. Although you will have to check the feature matrix for the current version of Visual C++ (i.e. 2005 version) on the MS web site to see which edition has which features. I suspect the free edition does not have 64-bit target build support for...

C++: Visual C error, error lnk2001 unresolved external symbol, unresolved external symbol
error lnk2001 unresolved external symbol, unresolved external symbol, lib files: Possibly. I cannot say for sure but can give some general advice and make a more specific guess at your problem. General advice: ------------------ This is a linker error. The linker (which links all the individual modules of a program together) cannot...

C++: Visual C++ .Net, microsoft visual c, mfc projects
microsoft visual c, mfc projects, managed c: Hello Trent, thank you for the question. Maybe they re 2 separate things, but when people I know refer to .NET programming it is just referring to programming using Visual Studio.NET. If they are referring to some kind of application that I m unaware of,...

C++: Visual C++ & SRGP library, visual c 6, lib files
visual c 6, lib files, line style: Sean, Thank you for your question. I regret that I am unable to take the time to study your source code due to the volume of questions received. It sounds to me that you have not obtained all the .h files needed by the .c files. Since I am not familiar...

C++: Visual C++, Video tutorials requested, video tutorials, visual c
video tutorials, visual c, dear mr: Dear Venkat! Forums are available even in our website , of course im an expert in C++ But in DOS , not in windows , Im sure experts are available in windows also please make a note of that! Computer based turorials ( CBT ) are available for visual...

C++: Visual C++ and Visual Studio, dependent functionality, vc code
dependent functionality, vc code, visual c: Hi, Visual studio gives you an IDE and uses Microsoft developed compilers depending on the type of project. using which you could write a VC++ code. VC++ is basically C++ with added facilities provided by Microsoft to develop software for Windows. You...

C++: Visual C++ and Visual Studio, ansi code, intensive purposes
ansi code, intensive purposes, visual c: Hello Adrien, thank you for the question. For all intensive purposes, visual studio and visual C++ are the same thing. Visual C++ is like a child of Visual Studio. There is also Visual Basic, which is another visual studio project. Visual Studio is merely...

C++: Void functions and the switch operation (logic errors), logic errors, logic error
logic errors, logic error, using namespace: You do not get the file to do anything – it is a chunk of data. Rather you read the data in the file and perform operations on that data when it is read into memory. Then presumably once you have the result of the calculation you know how to display...

C++: value of coins, value of coins, conversion formula
value of coins, conversion formula, initial fear: Dear Jeffrey, Thankyou for your question. Well, firt of all don t be afraid of assignments, it will just end your initial fear in any kind of language. Jeffrey, i m sorry but i cannot get your question correctly. What i understood , i will try to help....

C++: value, undefined number, address issue
undefined number, address issue, memory address: Hello Daniel, thank you for the question. Don t you just hate these tricky pointer questions? Always very meticulous and intricate. I drew this one out on a piece of paper to make sure I got it right. I ll try to break this down into individual steps to...

C++: variable name and function name not known till run time, virtual instance, observable difference
virtual instance, observable difference, object behaviour: The short answer is no. The longer answer is yes, but not directly. You have to provide the code to read the variable/function names and values and provide the code to map the name to the variable or function. This is because the names of functions and...

C++: variables, arithmetic operations, program execution
arithmetic operations, program execution, integer type: In programming languages like C++ variables are things that can hold a variety of values, and the value they hold may be modified during their life time - that is the value a variable hold may vary! Without them we cannot calculate values, compute new values,...

C++: How many variables (foo) of the Foo type is created?, compilation errors, memory leak
compilation errors, memory leak, pointers: for(int i=0;i 10;i++) { Foo* foo = new Foo(); // local variable foo } In this you get it 10 times, 10 different as each time foo would be different.After every loop you lose the handle to the memory allocated as the variable is local. It gives memory...

C++: vector of vectors, endl, pushback
endl, pushback, iter: Hi Tirra, Replace vector vector edge graph; by typedef vector edge newTirra; vector newTirra graph; graph.pushback(somestuff); The following code would help you in that: # include iostream # include iterator # include vector...

C++: vectors & adding objects???, vector, vectors
vector, vectors, stuffs: Hi Dean, Say the class is as follows: class plant { // some stuffs }; int main () { plant *obj = new plant; // some thing vector plant * x; x.push_back (obj); } if the vector was defined as vector plant then you would be writing...

C++: how to verify a few group of number with alphabets, david spector, beginer
david spector, beginer, type values: kelvin lee , Thank you for your question. I believe you want to compare character strings. A character string is an array of char data type values. A char is an 8-bit signed number that represents a printed character. To compare two character strings,...

C++: virtual constructor and destructor, virtual destructors, virtual constructor
virtual destructors, virtual constructor, virtual destructor: Hello John, thank you for the question. 1. No, you cannot have a virtual constructor. Declaring a constructor virtual will result in a compile error. 2. Virtual destructors are commonly used with inheritance. Since an abstract class must contain a...

C++: virtual constructor, virtual constructor
virtual constructor: Hello, As far as common practice, when you inherit from a base class, make both the destructors virtual. This is allows for runtime binding with the compiler. Its like a way of making it smart and able to distinguish from when its calling a base or derived...

C++: virtual descructor, virtual destructor, widget types
virtual destructor, widget types, gui elements: The quick answer is that instances of derived types can be improperly destroyed if they are deleted through pointers to their base class. If such instances hold onto resources such as memory or file handles then these might not be released back to the system...

C++: virtual functions, virtual inheritance, virtual functions
virtual inheritance, virtual functions, virtual function: I think you may be confusing virtual functions with virtual inheritance. I also think that by values you might mean class instance data members. Virtual functions have little to do with values - other than the may take values as parameters and return a...

C++: virtual functions, virtual functions, convinience
virtual functions, convinience, profile status: Hi. I am sorry for in-convinience, actually, i apologize i am on vacations these days, and the profile status i guess got mistaken. Sorry again for in-convinience. Regards, Professional (P.S But regarding your question, virtual funcstions are basically...

C++: What is virtual inheritance?, virtual inheritance, c programming language
virtual inheritance, c programming language, multiple inheritance: This is something you find may be required if you are using multiple inheritance. In that case it is possible for a class to be derived from other classes which have the same base class. In such cases, without virtual inheritance, your objects will contain...

C++: visual basic 6 vs borland C++, general purpose language, integrated development environment
general purpose language, integrated development environment, vb ide: First I am not qualified to remark on Borland specific features – such as how good their GUI IDE (integrated development environment) or Borland specific C++ libraries or frameworks as I do not use the Borland C++ product. I can think of no reason for you...

C++: visual C++, sanity check, hello world
sanity check, hello world, visual c: Hello Edwin, thank you for the question. Are you checking the box for an Empty Project when you create your Win32 Console application? Not doing that will produce a bunch of useless code. Just a sanity check. Here it is in all its glory, hello world: ...

C++: visual C++, david spector, homework questions
david spector, homework questions, string array: Carlos , Thank you for your question. Is this homework? It is against my policy to do homework questions. I can help you with work that you have already done, but I cannot give you full answers. Please attempt to do part of the work, and then ask...

C++: How can I visual c++ program..., david spector, msdn library
david spector, msdn library, project settings: r, Thank you for your question. If you want to check whether a program is written in standard C++, there is a check ANSI option in the Project Settings. You can search Microsoft s MSDN Library at http://search.microsoft.com/us/dev/default.asp. David...

C++: visual c++, mp3 file, visual c
mp3 file, visual c, system information: Usually applications are not designed to be controlable by another program. However, you can get the system information about an application, using the system calls. In general, I don t know about what you can do with winexec, but it gives you a handle by...

C++: void POINTER, pointer arithmetic, void pointer
pointer arithmetic, void pointer, object pointer: In C and C++ a void pointer, or void * type, is a pointer type that points to no particular type of object. As such you cannot de-reference a void pointer (i.e. use what it points at) because the compiler has no idea to what type of thing it is pointing to....

C++: volatile modifiers, documentation states, modifiers
documentation states, modifiers, application code: What is the volatile modifier? --------------------------------- The volatile modifier is like the const modifier. The term used in the C++ standard is qualifier rather than modifier. Const and volatile are qualifications that can be applied to types. In...

C++: Wats the problem with my code?, set of integers, 3d array
set of integers, 3d array, stdafx: 1. Your program looks too complex, try to reduce the number of dimensions by changing the design, if possible. 2. Use a debugger to find from where the function and print calls return. I can see, function doesnt return integer through all paths - then how...

C++: Win32 WinProc - wParam, wparam parameter, code case
wparam parameter, code case, keydown: Hello Junaidi, thanks for the question. Sorry it has taken me longer than normal to get back to you, I spent all last night and some of today testing different ways of trying to accomplish what you want to accomplish. I even tried using GetAsyncKeyState...

C++: Window Icons, hinstance, window icons
hinstance, window icons, google: Hello Gareth, thank you for the question. To load your own icon, you have to pass the hInstance of the class (not NULL) and a string to the path of your own icon file. You get the hInstance parameter as the first parameter of the WinMain function. Then...

C++: Windows driver, david spector, virtual serial port
david spector, virtual serial port, msdn library: Adrian , Thank you for your question. No, driver development is not completely hidden, just poorly documented. You need to obtain the Device Driver Development Kit (DDK) from Microsoft. Unless you have some prior experience, you will have some significant...

C++: Writing Boggle Type Game?, 2d array, networking code
2d array, networking code, boggle game: Hello George, As far as the fast calculating at the end of the game, that shouldn t be a problem with processors being as fast as they are now. It looks like you just want to run a bunch of strcmp() s on a 2D array of strings, and again to compare answers....

C++: Writing to file using C over Linux, fedora core 3, data1
fedora core 3, data1, fclose: I am sorry but you might have noticed that I am an expert in the C++ section not the C section. This means that I no longer write pure C code, so I probably cannot give as good an answer as an expert who writes just C. In your case you have several problems....

C++: I want to do the following:-..., vertex arrays, open source product
vertex arrays, open source product, open source developers: Hello venky, thank you for the question. This task is a difficult one. First thing you re going to want to do is research how the data is stored in a .max/.3ds file. Once you know what s in those file types, you can start parsing and sifting through all...

C++: i want to know the extent of my knowledge, everyday technology, word expert
everyday technology, word expert, interview section: Dear Eddie, Thankyou for your question. First of all, regarding to answer how to know the extent then i would only say onething here, Computer Languages is such a thing, where you cannot ever measure, to which extent you have gained the expertise about...

C++: Sorry... =), int seed, space base
int seed, space base, void space: Well, if you could use a loop it would make things easier. But as it is the best way would be to add another recursive function to print spaces before calling col. You can then use the base_size - size trick to calculate how many spaces to print: #include...

C++: about windows api functions, david spector, system statistics
david spector, system statistics, win32 functions: Here is the briefest answer I can give: Use functions such as GetProcessTimes . If you need a better answer (rather than a brief one), I suggest that you post this question at www.experts-exchange.com, which is more advanced than allexperts.com. ...

C++: windows copy dialog, david spector, windows xp copy
david spector, windows xp copy, shell namespace: Ronen, Thank you for your question. I would guess that this can be done but that it does indeed require hooking and/or registering with the Shell for notification. Perhaps you can write a server that extends the Shell Namespace. I ve never done this,...

C++: windows copy dialog, component object model, user interface design
component object model, user interface design, windows xp copy: Hmm, this is not really a C++ problem is it? Not only that but I am not sure in what context this dragging and dropping is occurring. If it is in the Explorer or desktop or other parts of the MS Windows shell – which as you mention the standard copy dialogs...

C++: a wizard data type, c syntax, void operator
c syntax, void operator, stream object: In a word no. The types involved in the first case are different for a start, and the latter case is just bad C++ syntax. However that does not mean that you cannot get similar effects. For example you could create a type constructed from two IO Stream...

C++: word erplacement ..., david spector, word api
david spector, word api, msdn library: Mohammad , Thank you for your question. You will have to obtain the COM Automation Interfaces for Microsoft Word. This software will include instructions for its use, although you will have to learn how to do COM programming to use C++ to do this (Visual...

C++: write/read same file in the same .cpp program, cpp program, gnu compiler
cpp program, gnu compiler, buffer memory: Well you have two main approaches to this, both will work with the C++ IO Streams file streams. First you can: - open you file for writing - write the data to the file - close the file when done writing the data - open the file for reading - read...

C++: writing in a file, bit operating system, binary value
bit operating system, binary value, myint: You seem not to have not grasped the fact that when your value is an integer is _is_ a binary value - digital computers count and store data in binary. However using the most obvious C++ techniques to write to a file, the operator functions: ...

C++: writing a struct of variable size in a file, internal pointers, trivial programs
internal pointers, trivial programs, memory addresses: I am surprised that you have not twigged the problem here. You are trying to use random access using a fixed size on data you (rightly) term in your question subject variable size . In fact using std::string (I shall just use string from now on) or char...

C++: What am I doing wrong with my program?, int sum, s parameter
int sum, s parameter, point values: You seem to have started programming in this language recently. There are several bugs in your code. I ve corrected them for you. You ll need to compile them. You re returning from within the calcResults function several times. No subsequent lines after...

C++: okay....still a few problems, personal correspondence, alternate program
personal correspondence, alternate program, time function: Hello Varun, thank you for the question. 1) I don t know if this was just an oversite, but the function is called Sleep() with an uppercase s. This might fix your error. 2) I am unaware of a function called return. In fact, it couldn t be called...

C++: -------------------------..., yj, prn
yj, prn, visual c: Zij=Xi*pow(sin(Yj),3) can be done in C/C++ like: double temp, Z[10,20], Z[10], Y[20]; ... temp = sin(Y[j]); Z[i][j] = X[i] * (temp * temp * temp); you can also use the power function, but the above is easier. To print, just use normal printf or...

C++: xp codes, linux source, ms xp
linux source, ms xp, source codes: Im not clear with your question ! Do you mean you wish to view source code for MS - XP? if so ! You can t view that because it s a commercial product and not even an Open Source ! ( Manufacturers gives only the execuitable version of OPERATING YSTEM...

C: 16/32 bit, integer addition, premnath
integer addition, premnath, case of computer: Dear Anil Bakshi! Bits in terms of colors is actually the number of bits used to store information about a pixel , In 16bit mode each in order to represent a pixel 16 bits are required 16 bit mode is also described as follows either by 1:5:5:5...

C: C hardware related question..., svga programming, premnath
svga programming, premnath, question sir: Hi dear Mr Gerald !! Explaining all those stuffs what you have requested is of course very difficult i hope you know very well , instead i can help you in yet another way !! I kindly request you to follow the link given below and download the complete...

C: C Language, totorial, c lang
totorial, c lang, spam mails: Hi Arvind i can suggest you something better than sending a doc or pdf file i.e. you can join up my personal website created by me to help students learn and develop their skills better where you can view and write programs for elemenary level as well as...

C: Kbc program, atof, clrscr
C: Kbc program, atof, clrscr, fgetc

C: Programing In C, target string, source string
C: Programing In C, target string, source string, printf

C: Kbc program, beginer, qns
beginer, qns, thankyou: Hi Pooja Well I didn t knew that you don t want such a complex one please try this out and lemme know you can also mail me at joydeep1982@gmail.com http://www.scodz.com/ViewProgram.php?link=1023&uid=2 regards Joydeep Bhattacharya http://www.scodz.co...

C: need help to solve a question, premnath, printf
premnath, printf, third party: Hi dear Manny ! Swapping values between variable is of course very simple with the help of a third party typically a temporary variable , but it sounds bit difficult if you are restricted to use the third party (Temporary variable) Presenting you a simple...

C: Programing In C, programing in c, string function
programing in c, string function, doubt: Hi Saheli Check out this link here you can find all the string function inluding the three you are looking for http://www.scodz.com/ViewProgram.php?link=178&uid=2 In case of any doubt or problem please feel free to get back to me. regards Joydeep...

C: Rename according to time, daylight savings time, struct tm
daylight savings time, struct tm, asctime: Hi dear Sinn !! If you take a look at the sub components of the tm structure used by localtime , asctime , gmtime you might have find all integer components as follows struct tm { int tm_sec; /* Seconds */ int tm_min; /* Minutes */...

C: String Handling . ., quick brown fox, input the output
quick brown fox, input the output, strtok: Hi Dear Cathy ! Here i made some corrections with your programme , actually your programme is almost near to the expected result but there you commit a mistake take a look at this statements ! for(i=0;i len;i ) { p[i]=p[i 1]; } You...

C: Function Prototype, function prototype, function declaration
function prototype, function declaration: Hi Dear BM Prakash ! As you know well the execution is sequential starts from main() , any definition say MACRO , or global variables and function definitions or prototypes. if the compiler encounter any of the above said it will make a note on the symbol...

C: error : can't open stdio.h file, option menu, turbo c
option menu, turbo c, path name: Hai Dear Varshitha ! Open the OPTION menu from your IDE select Directories , there you supposed to enter the absolute path where your header files stored in your disk . Enter the path name , press OK Re-compile the program , sure you won t get any...

C: file in c, mform, fope
mform, fope, valid choice: Ron, In delete, you don t want to use a break. You want to skip the one that compares to what s in the file (stricmp() == 0) but you want to keep looping since you are copying while looping. You don t need any code after the rename. In edit, you have...

C: filter code, preprocessor output, filter code
preprocessor output, filter code, code description: Hi Peter, Many if not most compilers include an option or utility to generate the preprocessor output. This output has the conditionals (#if) resolved, but also, will replace all #defines (which may not be what you want). If your compiler doesn t have...

C: help plz, scanf, printf
scanf, printf, bita: Hai dear Bita !! I found few error s with your programme , check out the corrections done below ., #include stdio.h void main() { int n,i=0,j=0,num ,list[20]; printf( Enter n: ); scanf( %d ,&n); printf( enter numbers: ); for(i=0;i n;i++){...

C: Pointers, c runtime library, program bugs
c runtime library, program bugs, invalid addresses: & takes the address of the variable (or in some cases an expression). An address is a pointer. A pointer can be defined as well. int *i; i is a pointer to int, but can be assigned to point anywhere (even invalid addresses). *i loads (dereferences)...

C: plse help..regarding my parallel port program n C......., parallel ports, output pulse
parallel ports, output pulse, parallel port: hello viju, sorry for the delay.. I have not personally worked on parallel ports but i knw some of my friends who worked on it.So if you can mail me your source code I can debug it. And pls whenever you are asking someone to debug a program mention the...

C: .txt file as the output, dynamic memory, feof
dynamic memory, feof, getch: You didn t show enough code here. If typedef Info is *not* an array, then the following statement isn t correct: fscanf(Fp, %s %i ,&F[i].mname,&F[i].pieces); F here is an array but F is defined as Info. I believe you want: Info F[100]; where...

C: what could be wrong?, max case, hello bill
max case, hello bill, wrong choice: Hi Henry, 1. addPerson always passes the last element of the array. 2. updatePerson takes a pointer to emp and returns that pointer, but the return type of updatePerson is emp, not a pointer to emp. 3. printPerson takes a pointer to the last element...

C: Accessing serial port, outportb, tie pins
outportb, tie pins, inportb: The only way to do this reliably is to create and use a thread to process your serial data. Wait for data in a thread posting the data with a PostMessage (or SendMessage) to a waiting thread which processes the data. Don t be tempted to use the OnData ...

C: getting ASCII code, ascii code, code question
ascii code, code question, differentation: Ok. With %d it s still not right. :) printf( %d %d %d ,int(ch1),int(ch2),n); int(ch1) is the int representation of ch1, which is an address. ch1 is an address; ch1[0] is the char. The problem with printf is it cannot type check so there is no...

C: C, array index, equivalence
array index, equivalence, pointer: Because in C, an array is an address or pointer to the first element. The first element is 0 bytes from the beginning, so an index of 0 for an array is the first element. This comes from the basic equivalence in C: a[i] = *(a+i) and when i is 0 a[0]...

C: C language, random number generation, drand48
random number generation, drand48, c language: Some compilers see the function definition: int drand48() as not providing type information for the parameter and therefore doesn t serve as a prototype. Or if you are in one file calling srand48 or drand48 and there is no prototype, then the warning...

C: C Programming, mysore south, database accesses
mysore south, database accesses, definition syntax: You can do database work with C and/or C++ - in fact you can do anything. But I think what you want to do is use a library which supports database accesses. I don t think you mean you want to write database management code but code to use a database. In...

C: is this correct?, sieve of erastothenes, getche
sieve of erastothenes, getche, prime numbers: Hi Henry, I don t know what you tried to modify so I can t tell what s wrong. In my version the if if (flags[i]) can have an else and that else statement can sum non-primes. This is because the if tests for prime and sets the flags for multiples...

C: Decimals?, newton raphson, extern int
newton raphson, extern int, iters: Steve, The scanf( %d ... reads and integer. %f will read a float, and you need to use a type double variable with scanf. Some text above is missing by I think you re asking to check for numbers = 0 to issue an error. Unfortunately, since you nested...

C: Doubts in functionaluiyt of C code operation, input accel, format specifier
input accel, format specifier, fractional digits: Hello, %7.3f is an ANSI C printf (family of functions) format specifier to format a double expression. A specifier has the form: %width.prec width is the total field with for the complete number. prec is the precision (for %f the fractional digits)....

C: help with guessing game, guessing game, index values
guessing game, index values, int count: How about: public static int CharacterPositions(int[] userList, int[] numList, int &inList, int &inListInOrder) { inList = 0;//counts the number of matches inListInOrder = 0; //counts number in correct order List int...

C: need little help, nice project, touch typing
nice project, touch typing, tradeoffs: I can t speak for using C# over C++ since I don t know C#. Likewise for ASP.net. Although PHP is nice and powerful, it s a bit more difficult to debug than a program on the PC. You have to decide the platform - I don t know the tradeoffs or requirements....

C: PRECISION CONVERSION FROM STRING TO FLOAT, distinct numbers, hello bill
distinct numbers, hello bill, 123456798: Hi Oscar, Ok, for permutations of arbitrary numbers, you have to use a different storage type. One problem for me is I don t know what you re trying to solve. I m unclear on what permutation you re looking for. Are you trying to look at input and determine...

C: processor time, program source code, code complexity
program source code, code complexity, time complexity: Hi, I don t know about calculating code complexity, nor Linux, but standard C has a time() function to get a time in mS. I would think using it around the code and subtracting would give you runtime in mS for the code. I would suspect code complexity...

C: Reg : mobile apps using C, mobile apps, support libraries
mobile apps, support libraries, phone manufacturer: I have not developed apps for a phone recently. I would suggest contacting the phone manufacturer but I don t expect much help. They don t want their phones hacked. I think each phone would have their own development environment and support libraries. ...

C: regarding FILE struct., c runtime library, struct
c runtime library, struct, pointers: Hello, struct FILE and it s members are not meant to be used by the programmer. The pointers returned by fopen should not have their members modified because they keep track of the file and its mode for the C runtime library. Furthermore, the definition...

C: Segmentation error in max-min finder., segmentation error, command line argument
segmentation error, command line argument, minlon: Hello, Sorry, I missed something. sscanf takes addresses of variables: sscanf(str, %f %f %f %f %f %f %f %f %f %f %f e %f %f %f %f %f %f %f , &date, &time, &lat, &lon, &dep, &mb, &ms, &lat2, &lon2, &dep2, &scalar, &mmt, &strike, &dip, &rk, &str2,...

C: stack deletion, c program code, array elements
c program code, array elements, top of the stack: Hi Suzzie, I don t see where t is set. If t is the top of the stack, which is the last element in the array, then t should be n-1 (stk[n-1] is the last item stored). I don t see anything else except after removing stk the function exits. Bil...

C: still on the sieve, prime elements, prime numbers
prime elements, prime numbers, primes: what do u mean by optimization? you said if i print what it sets to 0, i will likely find an optimization. what this mean please? I said what it is: (note that the algorithm spends a lot of time setting elements to 0 that already are 0). Maybe there...

C: writing to a virtual COM port, open serial port, target device
open serial port, target device, int mask: Hi Judy, One thing I see that I don t like and always do differently myself is the SetCommState. Use GetCommState first to initialize current properties before changing some members and calling SetCommState. I think the way it is leaves you with some...

C: C-Floating number and precision, c standard, conversion
c standard, conversion: The result is true because the conversion from float to double is not exact when converting the value in a and the constant value 0.9. This conversion is done for the less than test per the C standard. The conversion of 0.9 must have one bit different than...

C: C program, c programming language, workout c
c programming language, workout c, array references: Sorry for the delay. It looks like the loop to sort the list is being terminated by the compare which should be used to determine a swap or not. int frequency(int words_freq[SIZE][CHAR], int location) {int temp1,temp0; int i=location,j=0,k=0; while(((i...

C: c from c++, c side, features of c
c side, features of c: If you learn C++, you will know how to program in C. In C, you simply don t have the features of C++ and must not use them. If you learn C first, it may be easier to learn what is different in C++. However, you say you want to learn them at the same time,...

C: c programing, c programing, beetwen
c programing, beetwen, bad behavior: Sounds like homework but I ll answer anyway. str[] is an array of char which is initialized with hello . This char str[]= hello ; is the same as char str[] = { h , e , l , l , o , 0 }; using str is the address of the array: printf(...

C: About calender, hello friend, problem thanks
hello friend, problem thanks, year 1: Hello, Normally I d say this is too involved and would pass on answering. But I ll give you some pointers to get you going. A big part of the problem is to print the calendar. Drawing the borders and filling in the day numbers is challenging. But it...

C: command line argument on C, command line argument, command line arguments
command line argument, command line arguments, bubble sort: Hello, The first part. Command line arguments are passed into main() in an array of chars (as strings) int main( int argc, char *argv[] ) ... If a program is run as: program 1 4 6 5 2 9 8 argc is 8 (argv[0] is filled in with the full path to...

C: about .exe file, c software, executable program
c software, executable program, dos windows: Compiling and linking to an EXE generates an EXE which is an executable program on any system the compiler compiles source code for. System means the hardware (like PC or MAC) and Operating System (like DOS, Windows or Linux on the PC). If it s compiled...

C: information regaurding the file structure members, pointer position, information regaurding
pointer position, information regaurding, c runtime: There are no examples of using the members of FILE and you ll never find it documented. FILE is used internally by the C/C++ runtime source code. The FILE struct allows the C runtime to keep track of the open file, the mode, where it s reading from, and...

C: main(), int type, c standard
int type, c standard, type int: The C standard says main should be of type int. Since this is the return value for the OS, a program can return a value. The int type is not enforced and it s common to see main have a void return type. In this case the OS simply receives and indeterminate...

C: plz help, malloc sizeof, problem whit
malloc sizeof, problem whit, insertion point: Notes: head=p; p is undefined here. Set head to NULL so you know the list is empty. malloc needs to be inside the for loop. You need to malloc each node. Also, inside the loop, if head is NULL, set head to the malloced pointer, otherwise, keep...

C: String acceptence in graphics mode.., blinking cursor, screen cursor
blinking cursor, screen cursor, cursor location: Hai dear Shruthi ! Happy new year ! IN graphics mode very well you can use the printf and scanf() functions in case of scanf() function , it won t display the blinking cursor instead you have to enter the values where there is no cursor to point to...

C: size of an int, x86 pcs, point processors
x86 pcs, point processors, point registers: Hello, sizeof int, float (and double) are defined by the authors of the compiler. Sometimes there are compiler options to change this, but most compilers are hardcoded. The sizeof int is determined from the native size of the largest working integer CPU...

C: stuck in loop.., floating point numbers, lajolla
floating point numbers, lajolla, delmar: if (idistrict 1 || idistrict 4) // --- no ; { printf( You have entered an incorrect value ); printf( Please enter 1, 2, 3, 4. ); goto begin; } else...

C: Thread mutex question, quad core processors, homework question
quad core processors, homework question, multiple threads: Hello, I m sure you know if you don t understand the question or problem, you cannot find a solution or answer. This is true for me also. The only thing I can offer is to see the problem as given to you and see if I can extract what the goal is and what...

C: about file handling, c fopen, fopen c
c fopen, fopen c, dos command: Hi Prashant If you are using Turbo C then try using system() to execute exe file the system function takes dos command as input and excutes it otherwise try execv for linux or try spawn. Please lemme know in case of any doubts or problems regards...

C: Graphics !, image editing software, third party tools
image editing software, third party tools, hardcopy printout: Hi dear Anitha ! Most of the Xp and recent version of Windows users experiencing this problem ,since XP prevents the direct access of resources and hardware , you can overcome this problem by using some third party tools available in net ! An alternate...

C: memory map, data segment, memory models
data segment, memory models, compiler vendor: Hi Dear G.Kalai ! Answer for this question depends on the operating system and the compiler ! For our discussion let me assume that you are using DOS based TURBO C 3.0 Compiler , This compiler supports 5 different types of memory model to hold...

C: Printing Strings !, c langage, long gap
c langage, long gap, printing strings: HI dear Eric ! Nice to meet you back after a long gap ! I didnt find any bug with your code , perhaps a small Grammatical issue grammar in the sense compatible with C langage , ie array index starts from 0 instead of 1 , Sure your programme genarate...

C: Run an EXE file, correct path name, tc directory
correct path name, tc directory, alternate solution: Hi dear Ashok ! I didn t find any problem withis programme , here is an alternate solution of you ! If you are using Turbo C/C++ compiler then you can insert the function getch(); at the end to view the result in the same output window ! Note : Before...

C: String Trinangle in C, printf c, anirban
printf c, anirban, initial number: Hi dear henry ! Nothing sounds interesting with this formulae n = (strlen(str)/3)+1 rough calculations says thats the number of spaces comes around 1/3 rd of the actual length of the string ! i ve added 1 since 1/3rd length will always results in fractions...

C: sample code pls.., minimum element, maximum element
minimum element, maximum element, malloc sizeof: Hi Dimples May be I have missed out your question. Its not a problem you can directly keep contact with me through chat n mail at gmail. Do post me their and I will definetly answer you My ID; joydeep1982@gmail.com Have Fun regards Joydeep Bhattacharya...

C: C++ binary i/o, file stream, ameer
file stream, ameer, bin file: #include string.h #include stdio.h int main(void) { FILE *stream; char msg[] = hey this the string i wrote in the bin file ; char buf[20]; //open your .bin file in write mode if ((stream = fopen( e:\myfile.bin , w+ )) ==...

C: C programming, premnath, initial value
premnath, initial value, c programming: Hi dear Scott ! Answer for this problem is a). Hi! Hi! Hi! Bye! Bye! Bye! Bye! Bye! Lemme explain you how this output was actually generated ! Initial value of i is 0 : Take a look at the first while loop ! while( i 4) { printf(“Hi!...

C: C programming, imperative programming languages, declarative approach
imperative programming languages, declarative approach, premnath: Hi dear Jasmin ! Although both iteration and recusion are almost equvalent , they are slightly differs in architecture , where as the purpose of reucursion an d iteration in computing environment is same , iteration describes the style of programming...

C: Creating header file, options directories, ameer
options directories, ameer, turbo c: hello pallavi! just check the path name you gave in options- directories- include directories place your .h file there and try compiling or suppose if your header file is in a path say,,.. d:\abc\xyz\add.h then mention the path in your .c file...

C: how to creat .exe using c, c prog, windows environment
c prog, windows environment, windows system: Hi Rahul As you know linux don t create exe files and if you need an exe file and use it in windows system then you need to compile your code in windows environment and then redistribute the exe. regards Joydeep Bhattacharya http://www.scodz.co...

C: how to creat .exe using c, c prog, windows environment
c prog, windows environment, windows system: Hi Rahul As you know linux don t create exe files and if you need an exe file and use it in windows system then you need to compile your code in windows environment and then redistribute the exe. regards Joydeep Bhattacharya http://www.scodz.co...

C: about creating .exe form c, c prog, nice day
c prog, nice day, cygwin: hi.. it is possible but i think you can follow the below given method. you can use gcc compiler in windows using cygwin.. download cygwin and install it..after which you can install gcc in windows opearating system. and also it may have few architecture...

C: displaying 32 bit color depth using c, graphics modes, graphic modes
graphics modes, graphic modes, bgi driver: hi saurav :) can you be more clear with your question? Color depth is a computer graphics term describing the number of bits used to represent the color of a single pixel in a bitmapped image or video frame buffer. This concept is also known as bits per...

C: firefox, mozilla source code, source code directory
mozilla source code, source code directory, ameer: its binaries are developed using various languages i guess. the browser s front end was developed in XUL, Javascript, XBL, and C++ better you please refer http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Directory_Structure#browser for more details...

C: graphics on turbo c, fairy tale book, raster data
fairy tale book, raster data, bmp file: Hi dear Dimples ! Sure , you can develop a story book using C , It will be good if you use bit map images to support your story , design a simple bit map image using ms paint with essential art work , and you can display those image using suitable...

C: hardware interaction, hardware interaction, arm boards
hardware interaction, arm boards, dos mode: actually there are a lot of ways to interact with the hardware. i guess you are asking about LED Blinking in embedded systems. for this puropse you need to use specific boards like motorola,arm boards,etc and you have specific compilers like Borland,Codewarrior,etc....

C: help.., premnath, bubble sort
premnath, bubble sort, ascending order: Hi dear Dimple ! Here is the code , i hope it would help you out in all respects ! # include stdio.h # include stdlib.h void main() { int *arr; int n,temp; int i,j; long sum=0,product=1; printf( Enter number of elements :...

C: help.., fairy tale book, using graphics
fairy tale book, using graphics, graphics programming: Hi Dimples Firstly the program looks very simple, if you know graphics programming put a loop to create a cool looking graphics just as you need and obviously plot those as per screen co-ordinate Try out and lemmme know the first step and then keep me...

C: Need for a solution, latin square, premnath
latin square, premnath, anirban: Hi dear Anirban Paul ! Thanks for your question , Presenting you the solution for this problem ! #include stdio.h void main() { int i, j; for( i = 0 ; i 4 ; i++) { for( j = 0 ; j 4 ; j++) printf( %d , 1+(i+j)%4); printf( ...

C: Non-recursive function, c programming language, recursive function in c
c programming language, recursive function in c, malloc sizeof: you dont need recursion to reverse a singly-linked list. but recursion is a good technique to reverse a doubly-linked list. why do you want without recursion? for your clarification purpose i am sending a source code which contains all linked-list operations....

C: need for a solution, latin square, square 1
latin square, square 1, printf: Hi Anirban Try this out int i,j,k; for(i=0;i 4;++) { for(j=0;j 4;j++) { printf( %d ,(((i+j)%4)+1)); } printf( ); } I have not compiled and tested the code. Please forgive me for any mistakes. regards joydeep Bhattacharya http://www.scodz.com...

C: please help, liter calculator, clrscr
liter calculator, clrscr, sears: Hi Carl The problem lies in line number 17, scanf( %f , ); this line i think should be replaced by scanf( %f , ); or some other float type variable. Please do lemme know in case of any further problem with the code. regards Joydeep Bhattacharya...

C: sample code pls.., fairy tale book, geometrical shapes
fairy tale book, geometrical shapes, initgraph: hi..how you doing? ya i am ready to help anytime regarding your program. first let me tell u the basics of graphics under C(turbo c). *include necessary header files(graphics.h) *you need to initialize the graphics driver. int gdriver =...

C: How to save asin Values in a file ?, sine wave equation, premnath
sine wave equation, premnath, samita: Hai Dear Samita ! Perhaps its simple to store the values of a sine wave equation, just follow the simple steps . 1. Create simple structure with two members say x , and asin of type double. eg struct sinvals { double x; ...

C: user defined header file in c on linux, file in c, c file
file in c, c file, path name: hi.. i guess i hav already answered this question to someone else .. just write a header file with .h extension in the .c file just include the header file eg.. #include myheader.h or mention the full path name in the include statement all the...

C: How to create command buttons ?, premnath, command buttons
premnath, command buttons, gui development: Hi dear Fawad! Perhaps its simple to develop text box and command buttons in C , only skill you have to possess is , just imagination skills , ie The key question is how to achieve realism? ask this key question at every stage of your GUI development...

C: gnu c,c++, mozilla source code, source code directory
mozilla source code, source code directory, tcl tk: there is nothing called gnu c,c++................guess u r asking about gcc. gcc and turbo are different compilers. turbo runs only in windows. whereas gcc can run in linux and all other gnu operating systems and windows also. to install gcc in windows...

C: C program, dos commands, library function
dos commands, library function, directory contents: in turbo c there is a library function which can be used to emulate dos commands and the results of the completed commands are displayed.. for eg: system( dir ); wil display the directory contents.. likewise u can use system( net user ); ...

C: C programing language, c programing language, structure name
c programing language, structure name, varible: structures are used to encapsulate many varialbe of different data types.. every structure has a name,variable and one or more members, the various variables are called members of the structure.. they r defined under a name. now these members should...

C: about this code pls, even values, int main
even values, int main, array: Like this - #include stdio.h #include conio.h #define N 6 int main() { int x[] = {30, 12, 51, 17, 45, 62,}; int i ; int sum = 0; for(i=0; i N;i++) { if(i%2==0) { sum+= x[i]; }...

C: FILE Structure !, FILE structure in C
FILE structure in C: Hai Dear Ganesh ! First of all let me confirm you that FILE is not a key word , perhaps its a user defined data type defined in stdio.h , presenting you the following code to justify my answer ! typedef struct { int level; ...

C: about inputing data into a 2x2 array, insertion sort algorithm, two dimensional array
insertion sort algorithm, two dimensional array, array array: HI Dear Henry ! Nice to meet you back with your question ! Of course its simple to read input to an two dimensional array lemme give you a code excerpt , will absolutely fit to the given two dimensional array for( i = 0 ; i 2 ; i++) { for...

C: Number Reversing !, Reversing a number
Reversing a number: Hai dear sushmita ! Here is the code , what you are actually looking for #include stdio.h void main() { int n , i ; printf( Enter a number: ); scanf( %d , &n); while( n ) { i = n % 10; n = n / 10; printf( %d , i); } ...

C: program to include c function in other program, Creating Header Files in C
Creating Header Files in C: Hai Dear Mr Venkat ! Of course its simple , just follow the instructions.( assuming that you are Turbo C/C++ user ) Create a file that contains all the re-usable functions , say fact() and so on and save with a .h extension say sample.h ...

C: c, stack overflow, program crash
stack overflow, program crash, execution time: Hi Ritu Advantages: Your code looks clean A part of code that requires multiple compution can be done at once It can be reused later if kept in a form of a header file Disadvantages: It requires more execution time Too much of recursion in a function...

C: data structure, data structure, pointer
data structure, pointer, confidence: Hi Tp This is impossible, people might ask you this question to test your level of confidence. if you need to delete the nth node then n-1th node must point to the n+1th node but since you having the address of only the nth node its next to impossible to...

C: disable keyboard using c, tsr programs, c code
tsr programs, c code, keyboard: Hi Sandeep I didn t inderstand hat exactly you are looking for if you wanna handle the keyboard to be turned on and off you can try out tsr programs. Otherwise please explain me the problem in details regards Joydeep Bhattacharya http://www.scodz.co...

C: data structure, node position, temp value
C: data structure, node position, temp value, structure type

C: pascal triangle using c, pascal triangle, spam mail
pascal triangle, spam mail, handy stuff: Hi Abhishek Refer to my personal website for this program that might be a very handy stuff for you. This is my personal website so i can assure you 0% virus and spam mail and will really help you http://www.scodz.com regards Joydeep Bhattacharya...

C: C language in Visual studio, sorting qsort
sorting qsort: Create a list of pointers to the elements, sort them (qsort is very efficient and fast). Scan the sorted list of pointers - duplicates will be next to each other. Radix sorting? I ve not heard of this. I suggest Google as a first line of defense. Bil...

C: C Number Guessing Program, number guess program
number guess program: Start with a flow chart or pseudo code. You have to know what you want to accomplish before you can put code to it. Some of the worst programs I ve seen are those where the keyboard went into use before the approach was outlined. Asking if the number...

C: data structure, internal search engine, postfix expression
internal search engine, postfix expression, expression 2: hi Binoy For this type of stuff you can consult my personal website http://www.scodz.com This is my personal website so I can assure you zero spam mail and zero viruses. You can use the internal search engine to locate any programs. http://search.scodz.com...

C: freeing a node in a data structure, malloc free linked list
malloc free linked list: I need clarification. Why isn t the node the same address received from dynamic memory allocation? Typically you allocate the node (e.g. with malloc) and the node has data members and the next member. When you re done with the node, deallocate (free)...

C: interpreters and compilers, Compiler vs Interpreter
Compiler vs Interpreter: Dear Mr Hope ! I wish to make few points clear between a compiler and an interpreter A compiler takes lot of time to compile the entire program , during compilation if your program is in need of any library reference all the code related to the function...

C: LNK2019, unresolved external symbol, error lnk2019 unresolved external symbol
unresolved external symbol, error lnk2019 unresolved external symbol, cdecl: You have a class with a member function: char *outImp(struct imp *) And don t have a definition in the class: char *className::outImp(struct imp *) This happens frequently from forgetting to put the className:: ahead of the function name in the...

C: about my project text editor, premnath, book projects
premnath, book projects, dos commands: Hai dear Sahil ! Describing all the aspects of the editor requires steady background of system programming , specially with file system , console management , and even keyboard handling and finally text processing. if you look for all in one just...

C: cannot run c++, asus m2n, f9
asus m2n, f9, f5: Hi I think your problem can be solved but i want you to follow the debug method i will suggest you first run the same program and as soon as it closes press ctrl + f5 you will be able to see the console window do lemme know whats written there and if...

C: Split, m 47, m 46
m 47, m 46, null values: strtok for your compiler isn t right, as it should return NULL for the 2 unseparated commas. If this is the case, your next best choice is to use strchr to skip to delimiter. Unlike strrok, strchr only checks for one char while strtok will use a string of...

C: toggling of keys, keyboard article, dos days
keyboard article, dos days, caps lock: 0x417 is from the DOS days where the BIOS used that to store flags. With WinNT and later that no longer works (in fact probably throws an exception). You can use the Win32 API call SetKeyboardState to set these keys, and GetKeyboardState to get them. ...

C: where do I begin?, 3 apples, math formula
3 apples, math formula, point values: There are 2 prerequisites: 1) Learn the fundamentals of programming. Often this is combined with number 2, but part of this one is how computers work, memory and files, and interaction with the OS. 2) Learn a programming language to be able to write...

C: about bits, book x, shift right
book x, shift right, logics: There are parts of the K&R book that you need to study, because without these building blocks, you re going to struggle understanding code, and you won t use those parts in your own programs severely limiting what you will be able to do in C. You need to...

C: C, atoi, int value
atoi, int value, pseudo code: You have a start. The pseudo code is a start. Now, put it in code, thinking about how to break it up into functions. Ideas: You need to get 2 numbers and convert to int. That s a good function for getting both numbers (the function can return the value....

C: C Compiler, cross platform c, gui libraries
cross platform c, gui libraries, compatibility library: Do you want to use GCC in Linux and in Windows, or, create program from the same code to run in Linux and in Windows. For the former, yes, GCC and other commercial offerings do have compilers that run on Linux and Windows. To create programs that run...

C: c - language, premnath, turbo c
premnath, turbo c, header files: Hai dear Ajay ! Lemme give you a simple idea about how to collect all the functions available in C !! Turbo C++ 3.0 provides a complete documentation for functions available in C and C++ .Thing you have to do is just a open the help menu from the...

C: c question, write program C programs homework coursework
write program C programs homework coursework: I know exactly what you want. Are you trying to learn to program? You won t learn anything by *me* writing *your* program. I m pretty sure this is home work or course work because I ve worked 25 years and no one has asked me to write this kind of program...

C: Disbale/Enable keys of keyboard using C/C++, keyboard keys, program exit
keyboard keys, program exit, ankur: Yes, you can. One way is through the registry to change the keyscan mapping. Here s a program that does it: http://webpages.charter.net/krumsick/ And a link to microsoft for another method: http://www.microsoft.com/globaldev/tools/msklc.mspx ...

C: Disbale/Enable keys of keyboard using C/C++, hardware bill, keyboard key
hardware bill, keyboard key, hardware programming: I assume you mean disable keys for the application. This can be done by hooking the Windows message look and eating WM_CHAR, WM_KEYDOWN, and WM_KEYUP messages. If you mean disable the keyboard for the PC, this is extremely difficult and requires a system...

C: Echo Back input to the user (Urgent), 2f, lf
2f, lf, array: Hi Andrew, I m unclear as to what you re trying to print. The printf of the value is outside of the for loop. What are you wanting to print? num2+1 is an address. num2[0] and num2[1] will print the 2 numbers as you have it. I think for the num2...

C: FILE, Extracting data from file !
Extracting data from file !: Hai Dear Priya ! As Your question say s that you wish to extract some data from the file using C , but haven t mentioned what data from which file , if you specify this things , i am sure i can give the best possible answer ! Thanks and Regards...

C: files, space 4, c compiler
space 4, c compiler, increment: sorry i don hav a c compiler here in my office.. tats y delay in reply.. i can send u the algo though.. try implementing it .. 1.open the file..and set a flag or counter to 0. 2.start reading 3.read till u encounter a space. 4.once u read a space...

C: help, c getchar, printf
c getchar, printf, char c: sent is an array of array of chars. In printf, you can t use sent, but one of the array of chars. You also have to convert the getchar to an index. If the user is entering 0 to 4 (which C sees as 0 to 4 ), use the line below: i = d - 0 ; printf(...

C: help plz, c getchar, garbage value
c getchar, garbage value, premnath: Hai Dear Bita ! Your code having simple issue , ie you failed to terminate the string using the null character that s why your program displaying some garbage value !! #include stdio.h void main() { int i = 0; char ch , word[80]; while(...

C: hi!, premnath, undefined symbol
premnath, undefined symbol, len: Hai Dear Che ! Thanks for your question ! But the familiar error Undefined symbol Len flashes only if you failed to declare that variable ( say in this case the variable Len) verify your program that you have declared it or not , if...

C: Merging Array !, Merging Arrays in C
Merging Arrays in C: Hai Dear bhadz ! We can append the contents of the one array with another array ( merging ) but its not possible to fuse two array s into a single array ! Presenting you a simple code that will merge the contents of the arr2 with arr1 #include...

C: need diff between C and Embed C, C vs Embedded C
C vs Embedded C: Hai Dear Manju ! There is a lot of difference between the C and Embedded C , C is ment for desktop application development , ( ie extensively used for desktop application development say development of tools , utilities , software s that uses the desktop...

C: please explain how is it working ?, slq, xdt
slq, xdt, putchar: I really think this forum is for questions about legitimate programming and programs. This program might do something, but it s not anywhere close to a realworld program. Why not run it in a compiler and tell us what is printed? Bill Thanks for the...

C: problem in free then malloc, dear bill, memory requirements
dear bill, memory requirements, html section: I will attempt to reply to all questions unless the asker asks me to write a program for them or do their homework. It s that simple. Does xce itself contain pointers? If so, to itself (i.e. linked list)? Sounds like xce, when reallocated, moved, and...

C: Question, scanf, question question
scanf, question question, double x: Testing possibilities (minimum anyway): 2 - Both positive tested x,y and y,x 2 - One positive and one negative x,y and y,x 2 - Both negative tested x,y and y,x With scanf (and printf) get into the habit of using double types with %f as this is the...

C: Question, global variables, local variable
global variables, local variable, running one: Hi Jason Any variable declared out side the scope of any function is called global variable and one declared inside is called local variable for example int globalVar; // global variable void main() { int localVar; //local variable //localVar...

C: regarding data structures in C, data structures in c, structures in c
data structures in c, structures in c, premnath: Hai Dear Raj Balaji ! Well i can remember you well .. How are ? how about your college ? Maze Problem was actually using the backtracking technique . ie . assume that a rat is running on a maze it randomly runs somewhere inside a maze once if the...

C: serial port interfacing, serial port COM
serial port COM: Yes, for sure. Assuming you mean in Windows, you open the COM port like a file ( COM1 is COM1 of course). Then use SetCommState and SetCommTimeouts to set the rate, parity etc. and timeout parameters. Hint: Use GetCommState and GetCommTimeouts and modify...

C: turbo c complier error, Turbo C Compiler Error !!
Turbo C Compiler Error !!: Hai Dear Karthi ! You can find similar error in all ANSI standard C Compiler , ANSI standard enforces that , in a C Program all the declarations should be done before the first executable statement ! eg Take a look at this programme void main()...

C: Unique XP Authentication, logon dialog, free software tools
logon dialog, free software tools, asymmetric cryptography: I m pretty sure with the advances of security in WinXP and Vista that this is close to if not impossible. That login is part of the OS at a deep secure level. You re trying to replace something I think even 99% of Microsoft itself doesn t know how to do....

C: about bits, book x, shift right
book x, shift right, logics: There are parts of the K&R book that you need to study, because without these building blocks, you re going to struggle understanding code, and you won t use those parts in your own programs severely limiting what you will be able to do in C. You need to...

C: C code linking error!, error lnk2001 unresolved external symbol, unresolved external symbol
error lnk2001 unresolved external symbol, unresolved external symbol, program dependencies: Modcode.c (cpp) has references to the functions listed above? Where are those functions defined? If there is source in your project with these functions, there is probably a calling convention problem (add __cdecl to the functions). If these are in a DLL,...

C: c, pointer, abc
pointer, abc: It s unlikely X would be 2 because X is a pointer. In any case, the answer is, the output is the contents of the address of 2 (which is going unused) and X will be 3. A better example is: char *X = abc , C; C = *X++; C is a and X points to...

C: i have doubt in c, extern int, c languge
extern int, c languge, global section: OK, thanks, that s better. i in this case is a parameter to printf. Any expression and number of expressions are allowed (as long as the expression is semantically correct). Your code doesn t show where i is declared. I d say outside of main (above...

C: PRINT PASCAL TRIANGLE IN 'C', unsigned int c, int depth
C: PRINT PASCAL TRIANGLE IN 'C', unsigned int c, int depth, printf

C: help, stdin, number 3
stdin, number 3, erros: scanf does no error checking or skipping of bad data. I think you re seeing echoing of the stdin which is why the printf Enter a number shows what you entered. The garbage out the last time is because there are erros and a number wasn t scanned. This...

C: help plz, c getchar, char c
c getchar, char c, printf: Hai Dear Bita ! Thanks for your question , ive written a simple code ,hope it will meet all your conditions , #include stdio.h void main() { char name[10][30]; int opt; /* Array can acomidate name 10 names of maximum of 30 characters */...

C: limits of memory allocation in C program, dynamic memory allocation, memory allocation functions
dynamic memory allocation, memory allocation functions, numerical recipes in c: In the end, all allocations you do (malloc or new) are going to go to a lower level OS memory allocation function. You can try the direct Windows Heap functions http://msdn.microsoft.com/en-us/library/aa366711(VS.85).aspx and see if you can allocate...

C: Main function, void function, default arguments
void function, default arguments, programming environment: Generally main should be called only from the OS to launch the program. I suppose if main had no arguments supplied by the user and you wanted to call it with default arguments that might be a reason. Or, have main call another function with either the arguments...

C: mallocs and frees, memory leaks, fatal crashes
memory leaks, fatal crashes, hello bill: You didn t say if this is under Windows or not. Either way, if you know you re not allocating without deallocating other than on startup (meaning as you say memory usage doesn t change after running - which you should do for a long time), it will not be harmful...

C: PRINT PASCAL TRIANGLE IN 'C', pascal triangle, c language
pascal triangle, c language, personal website: HI Abhinav You can try this link http://search.scodz.com/SearchPage.php?page=1&type=programs&qry=PASCAL This is my personal website you can use this as a point of your reference, it will surely help you in your learning process. regards Joydeep...

C: to ask about execution of graphics in window vista, compatibility mode, bgi
compatibility mode, bgi, exe program: Hello, BGI is 15 years old and required older video card APIs (interface). Windows Vista (and probably XP and 2000) probably dropped support for BGI. One thing to try perhaps: right click the exe program and use properties to set the compatibility mode....

C: better code?, loop unrolling, optimizations
loop unrolling, optimizations, kicker: Hi Sarah, This is a loaded question in a way. You can count on one thing, sometimes faster code is less efficient in code size. Often, less code is more efficient (faster). So when you ask for efficient, I assume you mean code size. Sometimes to make...

C: i am getting " FATAL ERROR C1014: TOO MANY INCLUDE FILES : DEPTH = 1024, in a C program., standard solution, codings
standard solution, codings, i don t know: You have #include files that don t prevent multiple inclusion. Meaning one includes another, which includes the first one, and that overflows the compilers internal #include stack. The standard solution that you ve no doubt seen in other programs is exclusion...

C: i am getting " FATAL ERROR C1014: TOO MANY INCLUDE FILES : DEPTH = 1024, in a C program., standard solution, codings
standard solution, codings, i don t know: You have #include files that don t prevent multiple inclusion. Meaning one include another, which includes the first one, and that overflows the compilers internal #include stack. The standard solution that you ve no doubt seen in other programs is exclusion...

C: i am getting " FATAL ERROR C1014: TOO MANY INCLUDE FILES : DEPTH = 1024, in a C program.
C: i am getting " FATAL ERROR C1014: TOO MANY INCLUDE FILES : DEPTH = 1024, in a C program.

C: graphical implementation, graphical implementation, decrement
graphical implementation, decrement, data structure: I m sorry I don t quite follow what you are asking. If you want a stack to push rectangle coordinates, you can use a pointer to structure. Allocate this and push the pointer. When you pop, use the coordinates and free the pointer. Or, to make it much...

C: graphics programming & linked list, charles petzold, mfc c
charles petzold, mfc c, c mfc: Hi Neal, 1. What do you mean by Graphical programming? Like Windows with window display and menus and all? If so, I don t know anything for C. MFC (C++) is quite popular and goes back 12+ years and is well documented and the online help in Visual C++/Studio...

C: micro, microcontroler pic, maine question
microcontroler pic, maine question, analog circuitry: Dear Fartaj, You can do this with a microprocessor *if* they have a timer output which can be set to meet these timing requirements. You would not be able to do this in software toggling an I/O pin. If the microprocessor s counter/timer doesn t have the...

C: Revesing string sentences, punctuation, sentences
punctuation, sentences, ot: You should break the string into the words. What you can do is at the first space or punctuation, replace it with a 0, that will terminate the word, which you can then reverse. Replace the 0 with what you replaced. If there are spaces or punctuation, skip...

C: rearrange string, loop program, prince
C: rearrange string, loop program, prince, maxmium

C: 'malloc' function, pointer arithmetic, memory corruption
pointer arithmetic, memory corruption, mac station: Alex, there is nothing in the code you posted that would normally cause a seg fault. You should, however, make tempr a long double. It s very likely that the heap has become corrupted through a bad call to free, or by writing past the bounds of allocated memory....

C: Reverses string contents using stack in C, c stack, exchange positions
c stack, exchange positions, last element: Hi dear mazlee! Need not to go for that much heavy processing ,say reversing , swapping kinda things just have a look at this simple program , uses stack to reverse the sentence #include stdio.h #include conio.h #define MAX_STK 200 void...

C: rearrange string, Sorting Strinngs in C
Sorting Strinngs in C: Hi dear Mazlee Mamat :) Ive programmed this simple programme exatctly matches your need using strncmp() function ( i know the earlier programme might ve confused you due to complex pointer usage ) have this simple programme #include stdio.h #include...

C: Strings in C, String Processing in C
String Processing in C: Hi dear Thushan. Here is the code i ve programmed for string manipulations what you have mentioned, please have a look. Note: in C We cannot add two strings like this str1+str2; which requires overloading of + which wasn t supported in C. so ive programmed...

C: Stuck on a problem using c, brick wall, boxa
brick wall, boxa, deprecate: You have to keep track of each box s capacity and decrease the capacity as you put items into the box. Each box will have its own capacity so you need as many capacities as you have boxes. If you have an array of boxes, you need an array of capacities. ...

C: simple club membership program, membership program, club membership
membership program, club membership: Philip, the first thing you should do is make a clear list of what you want your program to do. I don t know what a club membership program is. When you can clearly explain your program to another person, then you can start explaining it to a computer. ...

C: array of structure, scodz, Joydeep Bhattacharya
scodz, Joydeep Bhattacharya: Hi Pawan There are many errors in the code u have sent please remove the same and try again struct student { int name[10]; float marks; }a[2]; void main() {int i=0; for(i=0;i =2;i++) { printf( please enter the name of the student ) scanf(...

C: arrays, quik response, chris answer
quik response, chris answer, choice exam: Edit: Sorry, there was an error in the code I sent you. The corrected is below. Hello Christopher. No, you are not annoying me. If you intend to return a value from compareAnswers, you must delcare it as an int. That is the cause of the errors. You...

C: C++ File manipulation, c file manipulation, dev c
c file manipulation, dev c, management functions: Hello Marcus. The functions you are looking for are CopyFile and MoveFile. The MoveFile does the renaming. The usage is fairly simple. You can look them up in MSDN. See http://msdn.microsoft.com/en-us/library/aa364232%28VS.85%29.aspx for a all the File...

C: C programming, 30 days hath september, leap year
30 days hath september, leap year, 28 days: Hello Taj. Please post a follow-up question and show me what you have done so far. I will be happy to help you but I will not be able to respond until much later today. Best regards Zlatko Edit 1: Taj, in this problem is A always before B so that...

C: Common errors while handling files in C., Common errors while handling files in C.
Common errors while handling files in C.: Hi dear shweta! Common errors while handling files in C. We are porn to mistakes and not the computer; it’s just a servant to satisfy what we have ordered. Folowing are the common mistakes / error that every one can encounter while handling files...

C: c programe for prime number, c programe, optimization purposes
c programe, optimization purposes, preset number: Hi, Ming. You are very, very close with your answer already. I ve made a few changes to the program for optimization purposes, formatting purposes, and some minor functionality. The code is below. If you have any questions about it, please do not hesitate...

C: constant pointer, const int, type references
const int, type references, memory address: Hi, Ajay. First, looking at your code, it appears to be mis-categorized. Your second piece of code is creating a reference -- a C++ type. References and pointers are remarkably similar. They are both methods to access the same memory with different...

C: Data Structure, program result, premnath
program result, premnath, strncmp: Hi Dear Ram ! Sorry for the delay in responding please find the code below #include stdio.h #include conio.h #include string.h char Names[10][20]; void main() { char Temp[20]; int i,j; int n = 5; for( i = 0 ; i n; i++) gets(Names[i]);...

C: c programe for prime number, divisors, prime numbers
C: c programe for prime number, divisors, prime numbers

C: union REGS
C: union REGS

C: What would the following print?, ctr 2, code execution
ctr 2, code execution, infinite loop: Hi, Angela. The problem is that you have declared a global variable called ctr and used this in both loops. The code execution will go something like this: ctr = 0 (start of first loop) printf X (body of first loop) ctr = 0 (start of second...

C: header files, implicit declaration of function, microsoft compiler
implicit declaration of function, microsoft compiler, correct header: Hello Ajay. If the correct header files are not included, the C compiler will make assumptions about the functions you are calling. Compilers differ in how they handle missing function prototypes, but generally you don t want assumptions made about your...

C: Merge Sort, mergesort, cprogramming
mergesort, cprogramming, complexity: Hello Lahiru I will think about your problem. Have you tried to write a merge sort yourself? It would be good for you to try your assignments, then ask questions about what you don t understand. Do you need me to explain what a merge sort is? Are you having...

C: Merging char-arrays, output array, void sort
output array, void sort, bubble sort: Hello Ihsan. The easiest way to do this is to input the two arrays, create one large array with the data of both inputs, and then sort the large array. A more complicated way is to sort each input array and then merge the two sorted arrays into a final...

C: pls let me know the answer as soon as possible.., array index, head moves
array index, head moves, design choice: Hello Santosh First simplify your problem to 1 queue in an array. For your array, you have a beginning at 0 and an end at some array index. Lets call it END. For a queue you have a head, and a tail. Each is an index into the array. In a queue, items are...

C: question, scanf, real solution
scanf, real solution, fflush: Hi, Ankit. Please don t use the fflush function. The function is intended to flush the buffer provided (stdin in this case), but it not a standardized function. Because the function has no standard implementation, some versions don t implement it at all,...

C: Reverse satck ., program execution, isempty
program execution, isempty, zlatko: Canno, I don t have much time right now to look at your problem. I will look at it later today. But I repeat that you should remove all redundant code referring to stack node 1 Remove struct stackNode1 { char* data[15]; /* define...

C: Reverse satck ., exchange positions, last element
exchange positions, last element, program execution: Hello Canno Here are the changes you need to make: 1) change stackNode to have: char* data; as the data type. 2) change push to accept char* instead of int 3) change pop to return char* 4) Change your input routine to accept strings....

C: RSA Encryption in C, rsa encryption, demonstration
rsa encryption, demonstration: You can send me the code as an attachment to zlatko.c.help at gmail.com or you can post it as a follow up question. I do not know anything much about encryption. I cannot promise that I will have time to look at it if it is a big project. If you can describe...

C: Stack Operations, Operation on Stack using pointers
Operation on Stack using pointers: Hi dear canno ! I really really sorry for the delay in responding you :( just got committed with some project delivery , well here is your solution replace the code of your pop() function using this char* POP(StackNodePtr ptr) { StackNodePtr...

C: Unable to Include #include, compiler vendors, folder check
compiler vendors, folder check, option menu: Hi Dear shreyas! Usually a beginner used to get these kind of problems , ie errors like unable to include files , here ill explain you why ! In your C/C++ programs u might use some functions , upon using this you have to declare those , if in case its...

C: union REGS, union REGS ;
union REGS ;: Hi dear ashish! first of all i apologize for the late response. , coming to the point union REGS is just an union variable declared in DOS.H ( you can very well have a reference over this dos.h header file ) would be defined like this union REGS...

C: c programming, decrement, 12345678
decrement, 12345678, c programming: Hi, Sathish. Use two for loops, nested within one another. The outer for loop will contain the number you re counting up to and will decrement every time. The inner for loop will actually count up from 1 to the desired number and will increment every...

C: queries related to turbo c installation, Unable to include #include
Unable to include #include: Hi Dear Deepti, Happy Christmas! , I ve already attended many queries like this , please find the answer following this link http://en.allexperts.com/q/C-1587/2009/11/Unable-Include-include-stdio.htm please get back to me if it doesn t help you ...

C: Beginning a Programming language, level programming languages, ticket reservation system
level programming languages, ticket reservation system, air ticket reservation: Hi Joe ! I appreciate your interest in learning a programming language. definitely it will help you in your future higher studies. Lets come to the point. There are many categories of programming languages(pl). low-level -very efficient...

C: Beginning a Programming language, google search, c compilers
google search, c compilers, companion cd: Hi Joe, I would probably start with C++. It covers a lot of what you might see down the road. For better or worse, schools may be pushing Java, which this will help you get into, but is used less in the real world. And if you need C, that s covered too....

C: c programming, credit card terminals, programming language c
credit card terminals, programming language c, gas pumps: John, The list is substantial and more than I know or could find out. However, I do know that C is the language of choice for Operating System development, so you d find several dialects of Unix and Linux written in C, some of Microsoft Windows, and other...

C: c question, system dependencies, linux code
system dependencies, linux code, true c: Hello, Yes, it s true. C code is portable to any system provided that code doesn t rely on something the system does which is unique to that system. Your linux code is making a call to the OS which is specific to Linux and unsupported in Windows. What...

C: Serial programing in c, modbus, serial port hardware, programing in c
serial port hardware, programing in c, outportb: Boontham, I recommend you use a serial port access library - this code you found here is low-level direct I/O to the serial port hardware. First, this will run only on Win98 or earlier or DOS systems. Second, it will only work on systems with real UARTs....

C: creating virus, virus, virus writing
virus, virus writing, programming: hello, one can very well write a virus using c program. viruses can be written using asm,pascal,c,scrpiting languages,etc.... steps to learn virus writing : 1)learn how your computer works 2)learn operating system 3)learn assembly language 4)learn...

C: inportb() and outportb()
C: inportb() and outportb()

C: graphics and hardware/software, premnath, emulator software
premnath, emulator software, dosbox: Hi Dear aventika ! Don t worry , here is a simple solution , follow this link and download the software http://prdownloads.sourceforge.net/dosbox/DOSBox0.72-win32-installer.exe?download this is a emulator software , will will allow you to work...

C: inportb() and outportb(), c library functions, unix gcc
c library functions, unix gcc, standard c library: Hai dear Azeem ! The function s what you have mentioned ( inportb() outportb() ) are not standard C library functions and more over this is an exclusive property of Turbo C/C++ you cannot expect these functions on other compilers and over other platform...

C: recursion in C program, recursion in c, 2d array
recursion in c, 2d array, structures in c: hi .. sorry for the delayed reply. http://en.wikipedia.org/wiki/Recursion_(computer_science) http://www.cprogramming.com/tutorial/lesson16.html regarding 2d array using structures: u can declare it like any other structure member i guess.....

C: Syntax Error , Runtime Error , Type mismatch Error, Syntax Error, Runtime Error
Syntax Error, Runtime Error, Type mismatch Error: Hi Dear : vedant! Syntax error is the one which occur if there is a violation in arrangement or in sequence of tokens subject to a language specific grammar, Syntax error s will be trapped during compile time. Here is a simple example for syntax error...

C: asm code in C-language, c programs, c language
c programs, c language, help files: This question needs more information - most tools do it differently - it was never standardized. However, search the compiler s help files or manuals for #asm and #endasm, or the asm, _asm or __asm keyword. One of these is typically used by all compilers...

C: File Handaling with c luangage, How to use fseek() function ?
How to use fseek() function ?: Hi Dear HARESH R M! You can do this without any pain , simply just by the use of fseek() function., lemme summarize few things about this function! int fseek( FILE *stream, long offset, int origin ); the first argument is typically a file pointer,...

C: Query about signed and unsigned, undefined behavior, getch
undefined behavior, getch, unsigned int: You cannot count on the value of j when i 0; Assigning a negative number to an unsigned variable is undefined behavior in C and C++. Undefined behavior means there is no answer and the compiler can do what it chooses. It also means between platforms the...

C: warning: multi-character character constant, character constants, character constant
character constants, character constant, ascii characters: Multi-character constants are accepted, but as they tend to look like they should be single characters, or strings, the compiler issues a warning. It also tend to indicate a problem. In your case, it s a problem. TAB is going to be larger than 256 and...

C: c, pvalue, pointer
pvalue, pointer, memory: The line is type casting the pCdrFmtDtl- pValue pointer to a character*. A void* is, by definition, an undefined pointer. It may point to any type of memory and must be cast to something valid before it is used. This line is simply explicitly saying that...

C: c programming, code prints, memory address
code prints, memory address, equal one: The code snippet you ve given isn t compilable, but I m going to assume it should, instead, read something like the following: char s[]= hello ; char t[]= hello ; if(s==t) printf( true ); else printf( false ); The reason this code prints...

C: Help with translating C code into assembler code, type 32, printf
type 32, printf, c code: I m not sure what you re asking. Why compile C to assembly - that s what the compiler will do for you. On review of the code, why if the left and right feeler are 1, are you going left forward and right backwards? And for the previous 2 tests, why forward...

C: linked list, interface functions, phead
interface functions, phead, example purposes: The linked list is a simple, very commonly used data structure. Linked lists typically come in a two varieties, singly- and doubly-linked lists, with many different possible implementations. Typically linked lists are implemented with pointers, though they...

C: Query related to C, point emulation, runtime support
point emulation, runtime support, point operations: linkfloat is a function that causes the compiler, through the linker, to bring in floating point support (maybe emulation floating point). Without it, there is no runtime support for floating point, so those operations do nothing. With linkfloat, the linker...

C: 3D Game Programming, mundane data, games in c
mundane data, games in c, sine cosine tangent: The LaMothe books are very well known in the industry and most people have at least one book in the series. I happen to have a couple in the LaMothe series in my book shelf next to my desk. I don t have that particular one, but it reviews well. I can tell...

C: Converting Bytes to Float, byte array, contigous
byte array, contigous, simplest thing: In C, you do have to declare all variables at the beginning of a block. Alternatively, if you don t want the extra few bytes sitting around for the float*, you can just cast when you need to, such as: ((float*)byteArray)[0] = 3.141592f; // access and write...

C: c programming, c programming, national exam
c programming, national exam: Hiren, The program will print true for all values of a less than 0.7. is less than. If a is 0.6, 0.5 0, -1.1, -100.101 - anything less than 0.7 it will be true. It follows everything greater than ( ) 0.7 will be false. There s no need to remember...

C: How to extend memory sizes of C++, memory models, memory sizes
memory models, memory sizes, using graphics: Hello, It s not automatic in TC++ to increase memory. This is why Intel moved to 386 and 486 processors and TC++ was replaced with bigger and better versions of the compiler. You can look at using extended memory, but it s difficult to use and has to...

C: What is FILE in C Language?, code excerpt, file in c
code excerpt, file in c, premnath: Hi Dear hiren jobanputra ! First of all let me confirm you that FILE is not a key word , perhaps its a user defined data type defined in stdio.h , presenting you the following code to justify my answer ! typedef struct { int level;...

C: memory structure of C program, memory structure, structure of a c program
memory structure, structure of a c program, dynamic allocation: Hi Mahantesh, I would require some more clarity in order to answer your question. Memory structure of a program may mean its memory for its own code or for its variables or regarding dynamic allocation. So, I would request you to be more specific about your...

C: Question in C language, character array, ascii code
character array, ascii code, ascii codes: Hi, Sunny. I don t quite understand your first question, so I apologize if my answer doesn t quite meet your needs. If the answer I give doesn t help with the first question, please feel free to ask a followup question and give more details. Here is the...

C: Regarding development of text editor in C++, conceptual contents, premnath
conceptual contents, premnath, book projects: Hai Dear Abhay! Describing all the aspects of the editor requires steady background of system programming , specially with file system , console management , and even keyboard handling and finally text processing. if you look for all in one just you...

C: table sort, comparison algorithm, comparison function
comparison algorithm, comparison function, bubble sort: Hi, Eric. Your solution is almost right, it s just backwards. Essentially, what you need to do is exactly what your second idea would do. The string comparison algorithm starts at the beginning of the string and works forwards through the string, comparing...

C: volatile structure
volatile struct TEST { char var1; unsigned var2:1; unsigned var3:7; }; Does it make all members of this structure volatile? ---------------------------- Yes, all members are volatile. However, I ve seen a compiler not take volatile here,...

C: Array of Structure Problem, borland turboc, abnormal program termination
borland turboc, abnormal program termination, structure problem: It sounds like you re using an old compiler that tries to leave out floating point operations if they aren t used (and doesn t properly detect when they re used sometimes) such as Borland TurboC. The work-around for this is to include some function that clues...

C: Basic looping, worlds youngest parents, lions roar
worlds youngest parents, lions roar, youngest pope: Hi, Derek. There are a few ways to accomplish this, really. First, I ll give you a brief rundown of loop types. Please note that when I put // body , that I am just pointing out where the body of the loop, or the code that is executed within the loop,...

C: C programming - User Input issue, mailing address line, c programming language
mailing address line, c programming language, address number: Hi, Mike. OK, so there are a few problems here with your code. First, you re using doubles as storage for street number and zip code. I suppose I could see a double being used for street number, since some people live at half addresses. Zip codes, though,...

C: c programming, c programming language, language statements
c programming language, language statements, hiren: Hi Hiren, In the C programming language, statements beginning with # are called Pre-processor Directives . These are, in fact, directives to the compiler to conform to before it starts to compile the program. When we say: # include stdio.h ...

C: c programming, c programming language, semi colon
c programming language, semi colon, conditional statement: Hi Hiren The C programming language demands that all its statements should end with a semi-colon (;). So ideally, we can not write a statement wherein it is not followed by the ;. At the same time we can work around this problem with the following code:...

C: fwrite fn in TC, file abcd, structures in c
file abcd, structures in c, fwrite: Dear Ajinkya Your code is absolutely correct except for a small change which I have made. The rest is addition to your code for viewing the txt file. Please read the code and the explanation below it: #include stdio.h #include conio.h struct student...

C: need clarity, dear henry, arrays
dear henry, arrays, sorry for the delay: Dear Henry I m really sorry for the delay in responding to your query. The following is the corrected code: #include stdio.h int main() { int arr[6]= {0}; //initialising the array int num; int num_Entered; printf(how many number do...

C: preference of programming language, time transitioning, fortran 90
time transitioning, fortran 90, applicant pool: While it s true that FORTRAN is rarely used these days, it does still have its place in legacy systems, especially those used by governments and similar entities which generally have a difficult time transitioning to new technologies and abandoning entrenched...

C: program to on caps lock, numlock, num lock
numlock, num lock, key press: If this is a Windows machine, then the following will work (this particular example is num lock, but the code will work for others, too, just with different key codes). Also, please note: this particular program is really rather annoying... it loops infinitely,...

C: question, bzero, null character
bzero, null character, temporary storage: Hi, Sagar. This is a new one to me. I have no idea why, but I ve never seen the function bzero. That said, intuition tells me it s a function to zero out the allocated string, and a quick search confirms this. All it does is fill the specified memory...

C: rand and array, array size, random piece
array size, random piece, int time: I m sorry, I m not familiar with TCL, so I can t help you with the TCL version of this. The C version, though, is easy enough. There are a few ways to implement this, some better than others. Probably the best way would be to write a linked-list and use...

C: sorting, insertion sort, sorting algorithm
insertion sort, sorting algorithm, sort selection: The sorting algorithm names are (theoretically) descriptive of how they work. Bubble sort is so called because the items bubble to the top in sorted order. Insertion sort works based on the premise that it s building a new array, inserting elements...

C: Small Program in C++, dear bill, integer value
dear bill, integer value, printf: I will provide the part you request - you can finish the entire program. char *numStr; // Number as a string - like 93142 char *ptr; char small = 9 ; char large = 0 ; for (ptr = numStr; *ptr; ++ptr) { if (*ptr small) small = *ptr;...

C: C LANGUAGE, lib directories, options directories
lib directories, options directories, warm regards: Dear Priyanka There may be a few reasons for this error to appear. Check the following : 1) Whenever C compiles it requires the stdio.h file to be present in its tc/include directory. You can receive the above error in case if if is not there. 2) In...

C: C Programming, sum sum sum, sum of cubes
sum sum sum, sum of cubes, attempted solution: Hi, Abhimanyu. You clearly understand some of the basic concepts needed to solve this, such as the / and % operators, as evidenced by your attempted solution. There is a bit more to it than what you have, so I ve gone ahead and written out a program that...

C: c, production quality code, right triangle
production quality code, right triangle, malloc sizeof: Here is the code to print the lines of a Pascal s Triangle. Note that there is no attempt here to shift the lines to make them look more like a standard triangle. Think of this as Pascal s Right Triangle, perhaps. :) I m also not cleaning up dynamic memory...

C: c graphics, microsoft windows operating system, microsoft article
microsoft windows operating system, microsoft article, graphical controls: Sir: Thank you for your question. Although I don t have experience solving this particular problem, I will try to direct you to some resources. First, I d like to say that this is not a C question in particular, and you might find it easier to solve...

C: about c language, c programming language, renny
c programming language, renny, c language: Dear Vino I have not understood your question clearly. Do you want to learn C ? In that case you should go through Schaum Series book called Programming with C or use The C programming Language by Kerninghan and Ritchie. Hope this was of help to...

C: c language, compiling program, int sum
compiling program, int sum, value error: Hi Sofia When your compiling program says Function should return a value it means that you have declared a function with a return value, but when you actually define the function, you have not returned any value from it. Eg: #include stdio.h int...

C: exe file, project directory, c files
project directory, c files, exact answer: When you compile a program, it generates an executable. It may not be immediately obvious where this executable is stored, but if you look around in your settings, you should be able to discern this. In Visual Studio, for example, the default location...

C: GRAPHICS, graphics interface, printing graphics
graphics interface, printing graphics, native windows: The Borland Graphics Interface (BGI) is very old and intended to run in DOS, not Windows. I ve seen a few people referencing BGI lately, and I would suggest that you find a different route for printing graphics. The native Windows API is robust and easy...

C: To open the page of c prog., tc directory, ur programs
tc directory, ur programs, documents and settings: Hi dear Nitya! It seems you are a newbie for computers, no probs even ive came across the same problems 6 years ago. First thing is you must have the C/C++ Compiler to be installed in your computer if not please download a copy of Turbo C/C++ Compiler...

C: Return type of main(), return type of main()
return type of main(): Hi dear Nelson! By default all the function defined in C program will have the return type is of int and not void eg if you define a function sample as sample() /* function defined without specifying any return type */ { . . . } ...

C: Sum of Cubes of numbers, Sum of cubes of the digit
Sum of cubes of the digit: Hi dear Abhimanyu ! Sorry for the delay , since i was busy with some project issues , kindly check out the following code! #include stdio.h void main() { int i,n,temp,digit; long sum=0; printf( Enter the mximum number : ); scanf( %d ,&n);...

C: source code of C++ Compiler and interpreter, gcc gnu, free compiler
gcc gnu, free compiler, gnu org: Most compilers consist of copyrighted material which is very, very protected. You will not be able to obtain the source of most compilers without being an employee of the company which distributes them. That said, GCC is a free compiler released under...

C: Text Files, getc, char c
getc, char c, renny: Dear Tumelo Quest First, I d like to apologise for the delay in replying. About your question about opening an existing text file in read only mode, here is the answer: First make sure your file is created and the last character in it is the Enter ...

C: Turbo C using fseek, fopen c, cs code
fopen c, cs code, clrscr: Hello Bryan. You are correct that you should not be using fseek. The code to find a record based on the employee code is shown below. I have included full error checking as an example. Best regards. Zlatko #include stdio.h #include string.h int...

C: Turbo C using fseek, fopen c, cs code
fopen c, cs code, clrscr: Hi, Bryan. This isn t really a case where you would use fseek (sort of, I ll explain in a bit). You re searching for a particular employee code, which is a string. This means you need to search the employee records for the employee with that string...

C: array, freshman student, dimensional array
freshman student, dimensional array, hi friend: Hi Isheen Kae That is simpler still. You ll have to provide the char array the values at the time of declaration itself. The following is the code: #include stdio.h #include string.h void main(){ char names[][10]={ TOM , SAM , JON...

C: C programming, strict guideline, esc button
strict guideline, esc button, exit condition: Hi, Tumelo. The simplest way to do this is to use the exit function. The format of the exit function is: void exit(int exitCode) The parameter is the exit code, or the return value given by the application. Generally, 0 is used to indicate a...

C: c program, denominator numerator, numerator denominator
denominator numerator, numerator denominator, numerator and denominator: Hi, Harvey. Below is the code to receive a fraction input by the user and reduce it to its lowest terms. If you have any questions about the code, don t hesitate to ask. I m here to help. #include stdio.h void main() { // Numerator and denominator...

C: c program, modulus operator, program question
modulus operator, program question, printf function: What compiler are you using, and can you copy/paste the specific warnings? What happens when you debug the application? Is it simply taking a long time in the for loop? I tested and verified the code on my own machine before sending it to you, so it should...

C: c++ programing, c programing, conceptual difference
c programing, conceptual difference, more time than others: Hi, Thao. Your first question, what is it that I need to become a good programmer, is a bit difficult to answer. Time, patience, practice... these are all required. I firmly believe that anyone can become a good programmer, it just takes time (and some...

C: c programming, scodz, address of main
scodz, address of main: Hi Prachi The question needs some more info this program should work in turbo c which compiler are u trying try this in u turbo c compiler #include stdio.h void main(){ printf( %u ,main); getch(); } Please get back to me with more...

C: c programming, microsoft compiler, gnu compiler
microsoft compiler, gnu compiler, c programming: Hello Prachi You are correct. The program should print out the address of the main function. I have tried it with the Microsoft compiler and the Gnu compiler and it works as expected. I would say the compiler you are using is not up to the standard. This...

C: charector and string manipulation using pointers, public service announcement, string manipulation
public service announcement, string manipulation, mental exercise: Hello Nick. I m glad to help, but I have to remind you that thinking about the strmatch algorithm is a good mental exercise. Thinking about how to do it will make you a better programmer and prepare you for your exams. Ok, that s my public service announcement....

C: doubt, question pool, premnath
question pool, premnath, location search: Hi dear sadhana ! This is Prince M. Premnath Answering your answer from Question Pool ! you have mentioned about SDRAM ( It doesn t matter what RAM You are using ) all the data that you are using in a program gonna be stored in RAM I need a clear...

C: Graphics and Vista, premnath, simple graphics
premnath, simple graphics, graphics program: Hi dear Apritha ! I Can understand ur issue , i ve answered similar question , but thats for opening IDE in full screen mode ,graphics program require the same thing. in handy you can use DOSBox utility ( a freeware) to resolve this issue. I recommednd...

C: PROJECT, typedef struct, project question
typedef struct, project question, assignment description: Hello Athira. According to the problem, the node count is incremented whenever a node is found using the search function. When you find the node, you will have a pointer to the node. To increment the node count you would say node- count++; In the search...

C: Problem of skiping a address in structures., college printing, input works
college printing, input works, tcity: Hi, Kshitij. The problem you re seeing is a very common problem experience by beginners. The problem is in the way that input works. When you call your scanf function, it takes exactly what you tell it to and nothing more, leaving the rest of the buffer...

C: Read line whole line from the console in linux, length parameter, warm regards
length parameter, warm regards, stdin: Dear Dipen Thank you for explaining the problem so well, but in order for me to be able to help you, I would need the code that you are working with. Kindly send me the code and I will be able to tell you how we can get what you want. Warm Regards Smitha...

C: Reading line from the standard console, reading line, input request
reading line, input request, reading input: Hi. The problem you re seeing is a very common problem experience by beginners. It has to do with the way input is handled. It s a buffered input, and when you do not use the entire buffer, what s left ends up being used the next time an input request...

C: string and charecter manipulation using strings, terminator character, null terminator
terminator character, null terminator, double loop: Hi, Nick. I generally prefer not to just give code, but I m a little tired right now and it s easier to just write the function than to try to go over it all in English... I think I may speak C/C++ better than I do English these days, and my mom s an English...

C: Writing a simple c program using a linked list, fundamental data structure, head node
fundamental data structure, head node, simple c: Hi, Jeff. Don t give up just yet. I firmly believe that anyone can learn to program, some people just figure it out faster/more easily than others. It doesn t matter if it takes you a bit longer to understand the way programming works, you can still figure...

C: array, character array, array size
character array, array size, atoi function: ydur, here is a simple example to get you started. It is up to you to write the sorting function. I have put explanations into the code. The code compiles and runs, but doesn t sort. It also doesn t do any error checking, but that is a more advanced subject...

C: How many bytes, sizeof, printf
sizeof, printf, return values: Hello Rudolph. It is not possible to find how many bytes a function occupies in this way. What sizeof is returning here is the size of the return value of the function. I don t know why it is 2 in your case. Perhaps you are using a very old system. On my...

C: C Programm to interact with Winodws, Windows
Windows: This task can be achieved by using system() Function and DOS shutdown Command. //This program will just opens a GUI Interface. #include stdlib.h #include stdio.h int main() { int stat = system( shutdown -i ); ...

C: main() function in C, command line arguments, programming environments
command line arguments, programming environments, c strings: Hello Stefany. There are 2 correct versions of the main function that are used most often and that you should know. Both return an integer. int main(void) and int main(int argc, char** argv) The argc is the count of the command line arguments,...

C: showbits(), vc++
vc++: Hi Hasyamayee, This question is out of domain and i don t have much experience as far as vc++ is concerned but after concerning with few people i think vc++ does not have any showbits() function . I can be wrong , so i would suggest you to direct this...

C: about algorithms in 'c' language, sorting algorithm, algorithms in c
sorting algorithm, algorithms in c, time units: Algorithms are judged on speed and correctness. Of course an incorrect algorithm is worthless. The speed is based on how the running time grows with the size of the data being processed. For example, with a sorting algorithm, the running time might be...

C: C programming, c programming, c program
c programming, c program: Hello Rasanu. If you are having trouble with this assignment, I suggest you break it down into a series of simpler assignments. First write a program with a loop to print all the numbers between 100 and 200. Then add the feature of adding all the numbers...

C: C programming, point thanks, good starting point
point thanks, good starting point, c programming: Hi Rasanu, The program for which you are asking for is quite simple. You must try it yourself at least start and if you face any problem , in that case ask me. You just have to just write a program that takes input from a file in a string. Now once you...

C: C programming, abstract data type, manipulation code
abstract data type, manipulation code, struct definition: An abstract data type (ADT) is one which is manipulated by functions and where the user of the data type does not need to know about the implementation of the data type in order to use it. Consider a singly-linked list. There are two different ways to approach...

C: Call histogram, cdr file, knowldge
cdr file, knowldge, teletraffic: Hello Tana. The while(1) would normally be an infinite loop, but there is the line if(feof(inFile)) break; /* exit the loop if we have read all the lines */ which will break out of the loop when the program tries to read past the end of file. It just...

C: c
Hi priya, I think you wanted to something like this: #include stdio.h void func(char **s1,char **s2) { char *t; t=*s1; *s1=*s2; *s2=t; } int main() { ...

C: c, inward spiral, printf
inward spiral, printf, matrix: Hi Priya, It will be something like this for(int i = size – 1 , j = 0 ; i = 0 ; i–, j++) { for(int k = j ; k i; k++) printf(numbers[j][k]+ ); for(int k = j ; k i; k++) printf(numbers[k][i]+ ); for(int k = i ; k j; k–) printf(numbers[i][k]+...

C: c language, sending signals, c editor
sending signals, c editor, signal handler: Hi Sandeep, This question is more related to OS than to C or any other language. Because when you are running in an infinite loop your OS has the control of the process and to get out of it you have to send signals to the OS. Now when you press ctl+c we...

C: const pointer in C, memory location, const int
memory location, const int, abhishek: Hi Bhupal, Pointer to constant: If pointer is pointing to constant variable is caller pointer to constant. We can not change the value of that constant and another pointer can also be assigned to a same const. variable to point to. for eg : char...

C: Extern storage class
Hello Ravi The behavior as you describe it is not correct. I can think of three possibilities to explain it. 1) You are linking in another object file which has count defined. or 2) You had count defined at one time, and then made it extern. Since...

C: explanation for stack in the memory layout, stack element, free software foundation
stack element, free software foundation, gnu general public license: Hi Bhupal, As you can see below in the back trace you start from main and call fun1 and from fun1 you call fun2 and this will goes on as you are calling fun1 from fun2 and fun2 from fun1 . So , you stack will look like something like i have pasted below....

C: hi, syntax of scanf
syntax of scanf: You should read the answer here http://www.cplusplus.com/reference/clibrary/cstdio/printf/ and here http://www.cplusplus.com/reference/clibrary/cstdio/scanf/ and then try using printf and scanf to do some basic things. Then, if you have trouble, show...

C: Initialisaton of a variable, garbage value, memory location
garbage value, memory location, preprocessing: Hi Ravi, How you assemble you program is not that important because when you define int i in the very beginning at that instance the compiler set asides the memory location for int i and when we reaches the end at the time of compilation it fills that space.So...

C: memory layout in C, machine language instructions, initialized data
machine language instructions, initialized data, data segment: Hi Bhupal, From your question i can see that you all ready know that memory layout is divided into 4 parts : If we talk about X86 architecture : we have (from bottom to up) : |-----------------|...

C: why ++n is faster than n = n+1, increment, processors
increment, processors, optimization: HI Bhupal, I am not much sure but i ll try to answer your question. In case of n=n+1 compiler use some generic algo which is used in case of addition. Because if you write n=n+50 , compiler will do the same thing as it does for n=n+1 , calls a generic...

C: sizeof() behavior, ascii value, behavior question
ascii value, behavior question, memory location: Hi , The thing here is that you are taking char *ptr and char str[] both as same but these 2 are entirely different quantities. Char *ptr is a pointer which will be pointing to a memory location. Now , if you want to store abhishek which of size 8...

C: sizeof() is an operator...?, value expression, cast operator
value expression, cast operator, incomplete type: Hi Bhupal, first of all thanks for all those great comments Now coming to your questions. 1 Yes sizeof is a compiler time operator . The sizeof Operator Consider the syntax of the following expressions: sizeof expression sizeof ( type-name...

C: Array's problem.., dynamic memory allocation, dynamic memory allocation in c
dynamic memory allocation, dynamic memory allocation in c, malloc sizeof: Hi Furqan, You can do this but not in this way , you can do this like this: int n; int *marks; and once you get the input for n , we have to allocate memory for this array, like this: marks = (int*)malloc(sizeof(int)*n); This is called dynamic...

C: algorithm, uses of algorithm, programming language
uses of algorithm, programming language, computer science: Hello Srinu An algorithm is any set of instructions to do a task. For example, if you write down the steps to add up all the numbers between 1 and 100, those steps are an algorithm. If you write down the steps to search for a word in a sentence, that too...

C: Bank account program, program source code, lab assignments
program source code, lab assignments, cplusplus: Hi Shayaan, I can provide you some links from where you can see and get started. In between if you face any problem , reply back to me. http://www.cplusplus.happycodings.com/Beginners_Lab_Assignments/code30.html http://www.mycplus.com/free-utilities/bank-management/...

C: C++, case statement, switch case
case statement, switch case, printf: Hi Eric, Here is your sample program: #include stdio.h void main() { int grade; printf ( Input grade : ); scanf( %d , & grade); switch (grade) { case 1: ...

C: C Programming, test score, c programming
test score, c programming, declarations: Hi Dear Mike ! Sorry for the delay in responding you , just got little busy ... fine , please find the solution below. I haven t tested it well , please ensure that the following program meets all your cases , feel free to modify the code the way you...

C: C programming, data base software, database stores
data base software, database stores, reading data: Hello Yes you can use C to achieve this project. You need to think about what will be stored in the database. Usually a database stores a key and a value. The key is the information you know and the value is the information you want to get. For example,...

C: C programming Continuation, login security, exit program
login security, exit program, menu choice: You can create a console interface with simple printf statements to prompt the user for input, and scanf statements to read the input. For example, have a function to present the user with a menu and ask for a menu choice, and then return the choice to...

C: c programming, stud 100, k 80
stud 100, k 80, student id: Hi Vanan, This is the correct program : #include stdio.h #include string.h #include stdlib.h /* define student record */ struct student { int id[30]; int marks[5]; /* for 5 subjects */ float avg , total; int grade; }; int main() ...

C: c series pattern program, prakash kumar, counter 000
prakash kumar, counter 000, abc program: Hi Prakash, Sorry for the late reply. This is known as power set. If you search net you can easily get many reference to get started. I am listing a few : http://rosettacode.org/wiki/Power_set http://www.velocityreviews.com/forums/t724320-power-set-implementation.html...

C: c series pattern program, prakash kumar, counter 000
prakash kumar, counter 000, series patterns: Hi Prakesh, This is known as power set. If you search net you can easily get many reference to get started. I am listing a few : http://rosettacode.org/wiki/Power_set http://www.velocityreviews.com/forums/t724320-power-set-implementation.html Power...

C: file read in, l leslie, inout
l leslie, inout, sarah 1: Hello Sue. The problem is that fscanf is getting stuck at the colon : between reading hours and minutes. The fscanf reads the hours, then it expects digits for the minutes, but the colon is in the way. It can never get past it. You can fix it by changing...

C: Pseudo Code for Input Validation Program, validation program, program question
validation program, program question, pseudo code: Hello Kanji The style of your pseudo code is closer to that of a programming language than it is to a natural language if your pseudo code goes as far a declaring variables. If that is the type of pseudo code your instructor wants, then I d suggest that...

C: Pseudo Code for Math Quiz Program, math quiz, quiz program
math quiz, quiz program, pseudo code: Hello Bellissa I am not quite sure what you are asking. I think you still want pseudo code, and not C code, and you want to break the program down into functions and describe the functions in pseudo code. Is that correct ? The program is pretty short...

C: Pseudo Code (using arrays), array element, integer array
array element, integer array, 7 digits: Sasha, the changes you are proposing are correct. Just change For index=0 through 9 to For index=0 through 6 and leave lotteryNumbers[index]= RANDOM (0, 9) as is. To check for repeating numbers, I can think of two options. Option 1 Every time...

C: Sorting, array length, middle values
array length, middle values, mergesort: Hello Sam I believe your sort is correct. I have tested it with an array of random integers of various sizes, and it works. I think you are not calling it correctly. You seem to have an array of structures and you want to sort the array on the orderNum....

C: Storage location of a variable ?, stack data, segmentation fault
stack data, segmentation fault, fault error: Hello Ravi I think the const int x is placed in a read only (text) part of the program. It probably depends on the compiler and operating system, but on my windows and visual studio compiler, it also causes a program abort. I suppose you are running on...

C: String compare, birth months, max point
birth months, max point, printf: Hi Tiffany. The else return 0 is happening as soon as the first string compare fails. You want it to happen if all string compares fail. Your code is this for(k = 0; k 12; k++){ if(!strncasecmp(month, months[k], 3)) { return k+1;} else{return...

C: new question, csv format, time complexity
csv format, time complexity, comma separated value: Hello Pradeep. How did you manage with the sorted 2D array problem? Was my answer to you helpful or did you find another way to sort the array? For your new question, you have just given me the problem statement. You have not told me what you are having...

C: strings, january february march april, january february march
january february march april, january february march, birth month: Hi Tiffany, Can you send me your full code , it would be easier for me to figure out the problem in that. Because for this code snippet i can t make out much except that your months array should be of size 13. I can tell you more if i can have a look...

C: Arrarys, outer loop, inner loop
outer loop, inner loop, random numbers: Hello Crysta It is not clear to me what you are trying to do because your pseudo code and your problem description don t match. Your problem statement says that you want to find repeated numbers in an array, but your pseudo code is getting numbers and...

C: binary searchcode, stdafx, search code
stdafx, search code, search strategy: Hi Mackie , Sorry for the delayed response , i was busy in something else. I think this is what you wanted: int main() { int guess=50; int low=1; int high=100; int response; int setguess=(low+high)/2; //So that from start we are at 50. printf(...

C: Check Array for Repeating Numbers (in Pseudo Code), array element, array size
array element, array size, lottery program: Hi Bellisa, Sorry for the late reply i went to holiday and got a bit lost. Here is the sample code which can help you in getting started : #include stdio.h #include stdlib.h #define SIZE 7 int lotteryNumbers[SIZE]; int num_already_used[10];...

C: c, pratap, www faqs
pratap, www faqs, c0: Hi Pratap, It depends on the compiler because when i compiled on my compiler(gcc) it compiled without any error and returned 3 as the output. There is similar type of problem explained in c faq s http://www.faqs.org/faqs/C-faq/faq/ 3.16: I...

C: c, big o notation, time complexity
big o notation, time complexity, n times: Hi Harish, Complexity of this program is O(n2) n-square only. 1. scanf( %d , &n); O(1) because its just executes once for whole program 2. for(i=0;i =m+n;i+=2) Now you can say that this is O(m+n) which is nothing...

C: c language, hash sign, preprocessor directives
hash sign, preprocessor directives, program statements: Hi Ajay, You can go through these links: http://docs.roxen.com/pike/7.0/tutorial/preprocessor/directives.xml http://www.cplusplus.com/doc/tutorial/preprocessor/ Preprocessor directives are lines included in the code of our programs that are not program...

C: Function/code, int argc, scanf
int argc, scanf, stdlib: Hi Mackie, I think you are looking for something like this: //compares if the float f1 is equal with f2 and returns 1 if true and 0 if false int compare_float(float f1, float f2) { float precision = 0.00001; if (((f1 - precision) f2) && ...

C: Isolating digits, number 0, number int
number 0, number int, digit number: Hello Clifton Here is another way using a lookup array, and some floating point routines to get the leftmost digits. #include stdio.h #include math.h const char* digitText[] = { zero , one , two , three , ...

C: issue with sizeof(), cast operator, loop condition
cast operator, loop condition, ints: Hi Dear Bhupal , Actually the return type of sizeof operator is unsigned int , where as -1 ( value of x= -1) is a signed integer, the ranges of signed and unsigned ints are different, and when they are compared to one another, the results can be surprising....

C: printf() behaviour, argument value, press any key
argument value, press any key, bloodshed: Hi Bhupal, A lot of these things depends on compiler. As i my case this is the output which i got 3 2 1 4 3 2 Press any key to continue . . . The thing is as i explained , in printf we will push very thing into the stack from left to right and...

C: what is the problem with the code..?, compilation time, code question
compilation time, code question, unsigned value: Hi Bhupal, It is not like this. This is just a Macro and it will simply replace the code at the compilation time. So, it you will write something like this: #define TEMP -2 int x = -1; if(x TEMP); It will get converted to if(x -2) and...

C: address reversing, pointer arithmetic, question thanks
pointer arithmetic, question thanks, right position: Hi, 1.First of all i would like to tell you that we can not swap the address like that . We can swap pointers but not addresses and if you want to do that what you can do is do some pointer arithmetic (one good link :http://www.cs.umd.edu/class/sum2003/cmsc311/Notes/BitOp/pointer.html)...

C: C, borland turboc, character array
borland turboc, character array, reading strings: Prior to this, I d never heard of linkfloat. Best I can tell, this is a bad hack to fix what is, in my opinion, a bug in your compiler. I take it you are using Borland TurboC. I ve seen a lot of people using TurboC on AllExperts. Borland TurboC is rather...

C: c, Graphics
Graphics: Hi Ankita , If you can tell me more about your requirements in that case i might help you in a better way. As for this question if you only want to print simple lines and don t want to use graphics or printf , what you can do is - you can use different...

C: c programming, null pointer, short circuits
null pointer, short circuits, programming question: 1. The value returned by main can be referenced by other programs (assuming that they called main and store the return value). It s often times used as an error code (if it s used at all). 2. If you see code referencing l-value and r-value, they generally...

C: Doubt on implementing stack using array!!, static memory allocation, return stack
static memory allocation, return stack, top of the stack: A stack is merely a data structure concept. The only rules that must be followed when implementing a stack is that data must be first-in-last-out. Often times, stacks are implemented with dynamic memory and pointers, but can be just as easily implemented...

C: dereferencing operator, indirection operator, premnath
indirection operator, premnath, memory location: Hi Dear rohit! Deference or Indirection operator in C/C++ is usually referred to * ( Pointer ) , means it operates on a pointer variable and returns the value at the memory location pointed by the pointer. eg: void main() { int p = 10; ...

C: Hi, c programming
c programming: Hi Hamza, I hope this will solve your problem #include stdio.h #include conio.h int main() { int n,c=1,i=0,b,j,k,l; printf( Enter desired hight : ); scanf( %d ,&n); for(i=0;i n/2;i++) { b=((n-c)/2);...

C: operator overloading, operator method, strcat
operator method, strcat, endl: Hello Sidra. Your operator+= method needs to take the characters in the parameter t , and add them to the s array in the object that the operator is being called on. You don t need any temp object. Here is the idea. const strng &strng ::operator+=(const...

C: remove duplicate value, array
array: Hi Kumar, What you can do is take 2 pointer (ptr1 and ptr2) , both pointing to the first element of the 2 arrays.(ptr1 - A ,, ptr2- B) Now compare them count = 0 while(count lenght(A) && count lenght(B)) { if(*prt1 *ptr2) ptr2++; ...

C: how to repeat the program ?, degree celsius, data ref
degree celsius, data ref, temperature input: Hello chuan jian What you need to do is put the entire code into a loop and at the end of the loop, ask the user if they want to continue. I ll bet you already tried that, but you probably had trouble with the user input. Getting user input can be...

C: swaping, posix threads, harshal
posix threads, harshal, thread library: Hello Harshal C++ does not have any multi-threading features built into the language. To do multi-threading you need a thread library for your operating system. For Microsoft Windows, you can use the Microsoft threading API. Look at http://msdn.microsoft.com/en-us/library/ms684254%28VS.85%29.aspx...

C: swaping, swap 3, million times
swap 3, million times, ticks: Hello Harshal. I believe you want to swap 2 numbers without using a third temporary number. The code uses exclusive-or operations. int main() { int a = 0x0F; int b = 0xF0; a = a ^ b; b = a ^ b; a = a ^ b; return 0; }...

C: tree, sorting
sorting: Hi ajay, The answer for your question is quite tricky. As we know the best complicity for any sorting method (except count sort and all hash based methods which gives you sorting complexity of o(n) but take huge memory) is o(nlogn) and that of Binary tree...

C: ARRAY, array element, variable arrays
array element, variable arrays, array elements: Hello, 10 thousand is not a very large number, we can allocate that much memory.But if you want to go beyond this you better use link list or vector in c++. Because they can take care of memory allocation, in case of these data structure we don t require...

C: array, spiral order
spiral order: Hi ajay, I think you are looking for this : #include stdio.h #include iostream using namespace std; int main() { int N = 9; int arr[N+1][N+1];//If you want the input to be entered by user , use malloc to allocate memory at run time....

C: bit problms, rightmost, xor
rightmost, xor, 00000000: 1.Write a function that inverts the bits of an unsigned char x and stores answer in y. == Answer to this question is do XOR with a number which has all bits set. #include stdio.h #include iostream.h using namespace std; unsigned int invert(unsigned...

C: C file handling, c programming tutorials, command line argument
c programming tutorials, command line argument, c file handling: Hi Soni, As far as your question goes i would like you to go through few of the links. They will explain you in detail how file handling works because i feel you will learn more in this manner . Few Links: http://c-programming.suite101.com/article.cfm/c_tutorial_file_handling_commands...

C: C file handling, drive path, cat command
drive path, cat command, c file: Hello Soni. I think I understand your question. You want to see the contents of your file using a command from the command line prompt. If you go to the directory where your file is, you can use the type command on DOS (Windows), or you can use the ...

C: c language, stdio.h
stdio.h: Hi sravani , 1.May be you have to set environment variable on your computer . To view or change environment variables: 1. Right-click My Computer, and then click Properties. 2. Click the Advanced tab. 3. Click Environment variables. ...

C: c question, Graphics
Graphics: Hi Naresh, As you have only sated in your problem that you are having problem with function setviewport() , I think this link will help you a lot : http://www.cs.colorado.edu/~main/bgi/doc/setviewport.html . If you are still facing any problem do...

C: data Structures, character array, scanf
character array, scanf, data structures: Hello Goraksh. The & is not required because with %s you are reading the characters into an array. An array automatically evaluates to an address. For example: char str[123]; scanf( %s , str); The str is automatically passed to scanf as the address...

C: doubt about c, printf function, operator precedence
printf function, operator precedence, memory location: Hi Dear Chandu ! Above programme will give the following answer if you execute it in Turbo C/C++ Compiler.. firstincr = 2 secondincr = 2 thirdincr = 1 Is this right ? answer : Yes it is !! This is little bit tricky/ difficult to understand...

http://en.allexperts.com/q/C-1587/2010/3/f/gui-programmin.htm


C: sorting two dimensional array in turbo c, diagonals, c programming
C: sorting two dimensional array in turbo c, diagonals, c programming, intersection

C: sorting two dimensional array in turbo c, getch, printf
C: sorting two dimensional array in turbo c, getch, printf, two elements

C: gui programmin, microsoft foundation classes, graphical development environment
microsoft foundation classes, graphical development environment, graphical user interface: Hello Jignesh. That s a good question. C does not have any Graphical User Interface (GUI) functionality itself. You need to use a specific library. On Windows I am familiar with Microsoft Foundation Classes (MFC) Dot Net Forms Qt On Unix/Linux I...

C: int final result reply, final result, precedence
final result, precedence, reply: Hi Rakesh, Yes your understanding is correct to a point . / has higher precedence than * and + , -. But precedence of + and - is same . So in this equation , we get = 3 + ( (4/3) * 7 ) -5 == 3 + ( 1*7 ) -5 == 3 + 7 -5 So if you subtract first...

C: int final result, onece, final result
onece, final result, precedence: Hi Rakesh , You are doing the same mistake here also . Precedence of / and * is more than that of + and / (divide) has higher precedence than * (multiply). So your equation will be evaluated as a = 3 + ( (4/3) * 7); a = 3 + (1 * 7 ); a = 3 + 7;...

C: Loop Question, std namespace, num num
std namespace, num num, int num: That s pretty good, but you are missing the increment of the loop counter num . Also, you probably need using namespace std at the start of your file. Objects like cout are in the std namespace, so you can refer to them as std::cout, or you can specify...

C: list, n'th last node
n'th last node: Hi Ajay, What this question ask you is that you should have one pointer at the end of the list and at the same time you also have one pointer pointer to a node which is n nodes before the last one . So , clearly we have to have 2 nodes . Now the thing...

C: random number, rand c, int max
rand c, int max, random numbers: Hi ajay, You can use rand function to generate random numbers. #include stdio.h #include stdlib.h //rand function is defined in this header file. const int MAX = 100; // This is the upper limit , to which you want to generate the random numbers....

C: result, dividing integers, operator precedence
dividing integers, operator precedence, assignment operator: Hi rakesh, First of all let me tell you some basics 1. If you divide 2 integers the result will always be integer . ex - int a = 2 , b = 5; float ans ; ans = b/2; printf( %f ,ans); Output - 2.00000000 and not 2.50000000 Because we are dividing...

C: STRINGS, reply thanks, last element
reply thanks, last element, sring: Hi SUDHANSHU, I think this is what you are looking for . In this case i am using a temp variable while swapping the characters .There is one more variant of this puzzle in that you have to reverse the string inplace i.e. like in this example only the out-put...

C: sorting two dimensional array in turbo c, dimensional array, turbo c
dimensional array, turbo c, bottom right: Hi. You ve done a good job with the algorithm to sort the diagonal. Realistically speaking, there is no difference between sorting top-left to bottom-right than sorting bottom-left to top-right. The only thing you have to change is the index you are referencing....

C: sorting two dimensional array in turbo c, dimensional array, bottom right
dimensional array, bottom right, turbo c: Hi julius, Code you are looking for is : for(x=4;x =1;x--) for(y=x-1;y =0;y--) if (a[4-x][x] a[4-y][y]) { temp=a[4-x][x]; a[4-x][x]=a[4-y][y]; a[4-y][y]=temp; } You just have to find a way to match 04 with 13,22,31,40 Similarly to match...

C: tree, Link-List
Link-List: Hi ajay, There are 2 ways to do this . 1.First one (easy one) - Create a new tree . Start from the first node of the list and move till the last and treat each node as a new input . It will be very easy because its nothing but simply creating a...

C: tree, iterative traversal
iterative traversal: Hi ajay , The code for which you are looking for is : Look the logic remains the same , but the only thing that is different is that in recursion we use system stack , here we are using our own stack . You traverse in the same way but while in recursive...

C: another twist, int foo, typedef struct
int foo, typedef struct: Hi henry, You can declare in any way you want to but the thing is, whether it is serving your purpose and is it easy to understand because once you write the code it will be some times used and managed by others. To increase your understanding you are...

C: working of +,/, - in c, integer arithmetic, multiplication and division
integer arithmetic, multiplication and division, integer mode: Hello Rakesh You are doing integer arithmetic in your program. With integer arithmetic, the fractional part is discarded. So we have: 4/3 = 1 1* 7 = 7 7 + 3 = 10 To get the answer you expect, convert at least one of the operands into floating point,...

C: how works +/, operator precedence
operator precedence: Hi rakesh, First of all let me tell you some basics 1. If you divide 2 integers the result will always be integer . ex - int a = 2 , b = 5; float ans ; ans = b/2; printf( %f ,ans); Output - 2.00000000 and not 2.50000000 Because we are...

C: api design, premnath, web portals
premnath, web portals, turbo c: Please tell me which operating system you are using and which compiler. I believe I answered your question yesterday. I have to warn you that if you insist on using C, instead of C++, your choices are limited. Also there is a lot to learn so you have to...

C: api, c gui programming, linux platforms
c gui programming, linux platforms, mingw compiler: Header files are added to your files with the include statement like this #include stdlib.h The compiler knows where to find the standard header files, but it needs to be told where to find the header files that you create or the header files of libraries...

C: C Language question, language question, senior citizens
language question, senior citizens, c language: Hello Shawn At first, simplify the problem. Don t worry about the summary. You can do that later when you are more comfortable with the problem. Try to write out in English the steps and calculations that your program is to do. Imagine you are explaining...

C: C program, string functions, string length
string functions, string length, c program: Hi Thameem, This is the code you are looking for: #include stdio.h int main () { char str[] = abhishek kumar is my name. ; char *ptr = str; int count=0; while(*ptr) { count++; ptr++; ...

C: How can i evaluate expression in if condition, string expression, n level
string expression, n level, c code: Hello Prasad It still seems to me that you need to write an interpreter to evaluate the C code at runtime. There are tools to make the job easier. You can use a tool called lex, or flex, to scan the string and break it into tokens. You can use a tool...

C: I cannot understand now also. Please explain with an example, Dynamic merroy
Dynamic merroy: Hi , Malloc : char * buffer = Abhishek ; char * storage = NULL ; int len = strlen(buffer); storage = (char*) malloc (sizeof(char) * (len+1)); //Here we are type casting malloc because malloc returns a (void *) and we have to explicitly type...

C: file handling, reply thanks, random data
reply thanks, random data, single line: Hi madhavan, I didn t understand your question clearly but from what i understood this is how you can go about it. You want to print data after the journal record line. So what you can do is read the file line by line and check for sub-string journal...

C: Graphics Library, linux platforms, compiler vendor
linux platforms, compiler vendor, knowladge: Hai dear Purna ! Sorry for the delay responding you, well i understood the problem since graphics is not a part of ANSI standard you cannot find much support for Graphics Stuffs , pretty much options will be available with this case , 1.Create ur...

C: GUI, graphics libraries, graphics library
graphics libraries, graphics library, google: There are numerous graphics libraries for C, many of them operating-system specific. If you want to write one that works both in Ubuntu and Windows, then you ll need to find a cross-platform graphics library that will work for both OSes. OpenGL is one example...

C: Hospital Information System, hospital information system, command line interface
hospital information system, command line interface, reply thanks: Hi Abdul, Hi Abdul, This is a big project .First you have to make a list of all the things which you want to have in this project. Just to start , lets include these things (once you find more you can simply add them , we ll design the project in...

C: illegal character, illegal character, premnath
illegal character, premnath, paste operation: Hi dear suzzie ! Sorry for the delay in responding you, this is all because of the copy paste operation, that might have included some illegal characters , can you please post the code ?? i may have a look into that we shall fix it asap :) Thanks and...

C: Minutes and seconds as arguments, printf statement, minutes and seconds
printf statement, minutes and seconds, void foo: You are being asked to write a function which you call that does the work. Just like your main function here is a function which takes no arguments, you must write a function which takes some arguments (or parameters) such as: void foo(int bar); ...

C: i need a help in c++, number minutes, input number
number minutes, input number, integer division: You use the ifstream for input, and ofstream for output. Here is the program. #include iostream.h #include fstream.h using namespace std; // you probably don t need this line int main(void) { ifstream fin( infile.txt ); if (fin) ...

C: I need help to design a project in Turbo C, quiz master, switch case
quiz master, switch case, turbo c: Hi Hamza, I ment something like this while(1) { //READ form the file(Txt file see below) the question in to string. //Print the question. //Read next 4 lines one by one and print them //Now ask for the input from the user , take his/her...

C: Please clear my following doubts sir. Its urgent I want immediately. Please sir., example answer, initial character
example answer, initial character, putchar: Hi, Question 1.Why are we especially using reverse(&sPtr[1]) why not &sPtr[2] or other? Answer 1.Here we want that in every call our pointer increment by one only.for example when you traverse the sting using a pointer you increment it by one once you...

C: Please explain the concept of dynamic memory allocation with an example, dynamic memory allocation, segmentation fault
dynamic memory allocation, segmentation fault, program prints: Hello The gets() has no way of knowing how much space is allocated for s. It will overwrite past the end of the allocated space. That corrupts memory and the results are unpredictable. In this case the program worked, but generally such a program will fail,...

C: programme, square root algorithm, how to find square root
square root algorithm, how to find square root, google: Hi nagaraju, If you wan to know the algo of how to find square root of a number i would suggest you better google because you can find many links that will explain you the algorithm clearly. Start with this one - http://www.homeschoolmath.net/teaching/square-root-algorithm.php...

C: programming, premnath, anshul
premnath, anshul, printf: Hi Dear anshul ! Code what you have posted would sure throw error . since the pointer has been used illegally , you can make the above programme valid just bu putting another * between a*b say printf ( %d , a**b); the above statement would bring...

C: programming language, language question, sequence 4
language question, sequence 4, incidences: Hello. Well that is a start, but you have to start your sum at 0, not at 1. There is no reason to ask the user for the sum, as you are doing with scanf. The sum is what the program is to calculate. I think the fact that the input is at least 2 integers...

C: Reading variable names from a file., macro names, switch case
macro names, switch case, variable names: Hello Islam I am quite sure that this cannot be done. A macro is not called at runtime. A macro is expanded by the pre-processor to generate C code before the actual compiler is called. Therefore, if a programmer cannot write the desired code in C, then...

C: searching a file through c program, e drive, c program
e drive, c program, kindest regards: On Windows you need the FindFirstFile and FindNextFile functions. You can see a sample of code here: http://msdn.microsoft.com/en-us/library/aa365200%28v=VS.85%29.aspx Try to create your program, and if you need more help, then show me what you ve done,...

C: C, linux places, intel machine
linux places, intel machine, code segment: Hello Amit. Yes, I agree with you. I think it is because Linux places the string in the code segment so it cannot be modified. I think Windows does not have the the same restriction. This site may give you more information http://linuxgazette.net/112/krishnakumar.html...

C: [C] Delete an element from a list, iterative function, second element
iterative function, second element, integer function: I did try it. The program I sent you makes a list of 0 2 1 0 2 1 0 2 1 0 It then deletes all the zeros, then all the ones, then all the twos, finally ending up with an empty list. I believe the algorithm is good, but you may have another problem causing...

C: C Programming on Devc++, decimal to hex, hex to decimal
decimal to hex, hex to decimal, hex value: Hi Kid, Sorry for the delayed response as i was very busy with my work . I wasn t able to get anything from the link you gave .So it would be better if you can send me the whole code , because then i can help you in a better way. Thanks, Abhishek Kuma...

C: C programming (ansi c standard), c library functions, infinite recursion
c library functions, infinite recursion, exit condition: May 13, 2010 ---------------- Hello Raphael. As I promised, I have looked more at the questions you have asked. I hope you have no more compiler errors. You wanted to do dynamic allocation of the set with malloc? That is not difficult to do. First you...

C: Confuse In Pointer...@, c prog, int result
c prog, int result, integers: Hello Vandan Here is some sample code with comments to show you how pointers can be used. /* declare 2 integers and a result */ int a; int b; int result; /* declare 2 pointers to integers int* pa; int* pb; /* assign pointers */ /* pa gets...

C: c
Hi, The answer is 1.Till stack overflows. In this program what you are doing is , you are printing persistence and you are calling main again and again . When you call a function form another function the address/other parameters are stored into the...

C: c, modulo operator, remainder
modulo operator, remainder, programmer: Hello Zizo The first part is keeping the decimal positive. So that if it is less than 0, it is multiplied by -1 to make it positive. The neg_flag is used to remember that the original decimal was negative. The remain is the remainder that you would have...

C: c, segmentation fault, trubo c
segmentation fault, trubo c, memory location: Hi Amit, I don t know why its is working on Trubo c but ican say for sure , if you try to do this on any other Os say , solaris , any flavor of unix , you will get error in each case and you youself know the reason. As far as Turbo C is concerned they...

C: c, ascii value, sizeof
ascii value, sizeof, 123456789: Hi Priya, For 1st answers are : 1 and 4 i.e sizeof(ch) = 1 and sizeof( A ) = 4 This is because in first case when we try to find out the size of ch which is declared as it gives us 1 because size is 1 .I think this is straight forward. In second...

C: c language, printf statement, stack area
printf statement, stack area, dependent libraries: Hi Hiren , As such we can not compare the size of these 3 files. As i show you: Case 1: cc -c abhi.c ls -ls total 10 4 -rw-r--r-- 1 achaudha sw-team 74 May 9 23:53 abhi.c 4 -rw-r--r-- 1 achaudha sw-team 892 May 9 23:56 abhi.o...

C: linklist and array in c, set of integers, insertion sort
set of integers, insertion sort, c sorting: Hi nidhin, I want you go through these links first because you will get all the coeds and explanation you require and if you still face any problem do reply back. a)How will you a linked list of integers in C?write a C function to the sum of elements...

C: Memory Corruption, memory chunks, heap memory
memory chunks, heap memory, memory corruption: Hi Lakshmipathy, Sorry for the delay. First , you should not free an allocated memory twice because it may/will cause trouble. And for your second question why freeing pointer twice gives error only in linux and not in Solaris is because the memory...

C: Need help with a basic C program, oneplayer, scanf
oneplayer, scanf, c language: Hello Zac. I think you did pretty well on your program. I have 2 versions for you. The first is your program with corrections made so that it works as you expect it to. My corrections are explained in the comments. The second version shows you how to use...

C: programming in c language, string concatenation, library function
string concatenation, library function, abhishek: Hi Parth, String concatenation is nothing but adding one string to another string. Like: #include stdio.h #include string.h int main() { str[16]= abhishek ,*ptr= kumar ; strcat(str,ptr); printf( = %s ,str); } Here ,...

C: return type in c, c programing, int result
c programing, int result, functions work: Hello Deepak A function performs a task. If the task is to calculate a value, the function must return the value. The return type describes the value. It specifies if the value is an integer, a floating point number, or something else. A function may...

C: Structure problem in c, floating point library, abnormal program termination
floating point library, abnormal program termination, structure pointer: Hai Dear ASHEERVAD! Sorry for the delay in responding you , i apologize . Usually this error occur only with Borland s Turbo C/ C++ compiler ,it doesn t always handle expressions such as &ptr- var ( - has higher precedence than &) correctly. This can...

C: some stiches.., struct stat, aa aa
struct stat, aa aa, null words: It is important that you get the percentage total to add to 100, (or 99.9999 with round off error). It is actually more important as a programmer that you solve that problem than it is to understand qsort. But I ll explain qsort too. Remember the loop ...

C: I want to write a C++ program., array element, element 10
array element, element 10, integer type: Hi Mahvish, After seeing your examples i have assumed that the elements are between 0 to 9. So i ll give a solution for this particular case. Suppose you are given an of size n and the elements in this can vary from 0 to n-1. In that case what we...

C: C programming, c code, c programming
c code, c programming, element: Hello Kuldeep The easiest way to do this is to first print the unique elements to the screen. Once that is working you can put the unique elements into a new unique array instead of printing them to the screen. You need to go through each element of...

C: CC++ Java, outer loop, inner loop
outer loop, inner loop, newline character: Hello Yaadi. You will need 2 loops, one within the other. The outer loop has to count from n down to 1. It will take care of entire lines. The inner loop should also count from the value of the outer loop counter down to 1. It will take care of the characters...

C: Cyrillic chars in cout, C++, printf c, hex editor
printf c, hex editor, mac os 10: The following link seems to contain the information you re after. Please let me know if it doesn t, and I d be glad to help you from there. Additionally, does the terminal you re working from have unicode support? What happens when you run the program? Try...

C: about c, executable file, c file
executable file, c file, c files: Hello Shankardas Once you have compiled your C file, you will have an executable file. To compile, means to create the executable file. From that point on, you can run the executable file and the compiler is no longer needed. The compiler is only needed...

C: c, c programming language, object oriented language
c programming language, object oriented language, procedural program: Hello Bhanu Object orientation is a way to organize your program. In object orientation, a program is subdivided into sections called objects. Each object has its own data and its own functions and, most importantly, its own definite responsibilities. The...

C: c language, c language, c programs
c language, c programs, detailed description: Hello Shaik To see the different types of errors in the C language, start writing C programs. When you compile them, you will see your errors. Your errors are the only ones that matter. After many years of programming, you will have seen all the errors that...

C: c programming, graphics program, linuxquestions
graphics program, linuxquestions, c programming: Hi Hiren, I haven t used graphics in linux myself , so i can t help you much in that way. But i found these 2 links if you go through them you will find lot of good info . http://zaher14.blogspot.com/2007/01/graphicsh-in-linux.html http://www.linuxquestions.org/questions/programming-9/what-is-equivilent-to-graphics-h-in-linux-177213/...

C: c programming, C spell check
C spell check: Hello lovein, I m very sorry it took me so long to get back to you. I m assuming in this case that dic_txt is your input file, in which case the file will either need to be in the same directory as your project. Otherwise you ll have to give the absolute...

C: converting from integer to ascii??, ascii character code, itoa function
ascii character code, itoa function, zero byte: Hello Mike That s great. You just about have it done. I ve put it into functions for you so that you can see how it is done. The program works for positive numbers and now works for a 0 input as well. Now you need to handle negative numbers. The problem...

C: converting from integer to ascii??, array index, elements
C: converting from integer to ascii??, array index, elements

C: Oh, Dynamic Programming !!!!, knapsack problem, recursive formula
knapsack problem, recursive formula, correct approach: Edit 7 July 2010 Hello Abody As promised: https://docs.google.com/document/edit?id=1ahc6MXn0WSmtQFA2H4gm8baMf5eR4m12jP4uVFHST7U&hl=en Hello Abody. Thanks for the question. It really makes me think. Today I don t have time to actually implement a program,...

C: question on c, command line c, smle
command line c, smle, jar file: Hi smle, That s so the loader knows where to start! Unlike Java where the point may be the name of the jar file or specified on the command line, C always starts with main(). void in front of main() is nothing but a way of that we are not returning...

C: question about c, c functions, questioner
c functions, questioner, c standard: Hello Smile. You are my first Nepalese questioner! In C, all code must be in functions. The main function is the first function that is run when a program starts. It is the start of the program. In C, functions can return values, or they can be written...

C: scanf and adding binary numbers, adding binary numbers, character contribution
adding binary numbers, character contribution, array size: Hello Mike. Good effort. Yes, functions are always the way to go. Even for a small assignment, your instructors will want to see that you can apply good programming principles which are crucial for large programs. If you will be going further with programming,...

C: scanf and adding binary numbers, adding binary numbers, input characters
adding binary numbers, input characters, decimal values: Hello Mike You have a loop for(i=0; i 2; i++) to input the two numbers. You know that you need to store one of the numbers in a temporary location while you get the second number, so you use num_store. But the second time through the loop the same...

C: add function and argv, digit input, integer representation
digit input, integer representation, numeric string: Yes you could use it as an autotester. You could put it into a separate autotest function, so that it does not clutter up main. There are a number of ways to structure it. You could use a conditional compile in main to call it or you could use a special command...

C: addition program tester, number additions, integer representation
number additions, integer representation, numeric string: Hello Mike. What I meant was to print the errors to a log file, not to the screen. It is quite common to store such errors in a log file. The user probably would not be interested in such a file and by the time the user gets the program, it should be running...

C: addition and putchar, digit input, integer representation
digit input, integer representation, number2: Hello Mike. This is a bug that happens often. You have copied code from one part of the program into another and in your copy, you did not change all the variables. for(j = 0; myItoA(number1)[j]!= ; j++) { putchar(myItoA(number2)[j]); }...

C: argv, putchar, number2
putchar, number2, integer representation: Hello Mike. You have a small misunderstanding about how to use functions. You don t need to make a separate parameter for each value that you might want to pass to a function. If you want to use the same code on multiple values, the correct way is to call...

C: C, extern void, extern int
extern void, extern int, example answer: Hi Shruthi, I think you can go through these links , they will help you out a great deal and if you want some docs etc , tell me you mail id , i ll mail what ever material i have . Pointers : http://home.netcom.com/~tjensen/ptr/pointers.htm http://www.augustcouncil.com/~tgibson/tutorial/ptr.html...

C: c++, switch case, case version
switch case, case version, flowchart: Hello Veronica, create your code with if-else. Then show me the code. If it can be converted to switch-case, I ll show you the switch-case version. Then you can use which ever version you want. The switch-case can be used if you want to check one variable...

C: c basics, c basics, obj files
c basics, obj files, helloworld: Deepak, An object (obj) file is one that has undergone the compiling phase, but not the linking phase. In other words, the code itself has been compiled, but the appropriate libraries for the code to use have not been assigned. So if your code is compiled...

C: converting from integer to ascii??, digit input, ascii code
digit input, ascii code, integer representation: Hello Mike. I am so very sorry. I sent you bad code for the reverseString function. I know I tried to test the code, but I must have read the bad output as being correct. Here is the correct code. void reverseString(char* input) { int i, j;...

C: count number, digits, C/C++
digits, C/C++, log: Shameem (I m very sorry for misspelling your name in the response to your last question, by the way), There are two ways to do this, the first way is best if you re reading the number from standard input, or from a file (i.e. the user is supplying the number...

C: difference, printf, good question
printf, good question: Shameen, Thanks for a particularly good question! In short, = means x is assigned the value of y , and == means x is equal to y . It s very important not to get the two mixed up. For most purposes, statements like x == y will return either boolean...

C: doubt in C, rewind function, code descriptions
rewind function, code descriptions, fscanf: A file has a file pointer and, when bytes are read from a file, they are read from the position of the file pointer. Each time a byte is read, the file pointer moves to the next byte. The fseek function lets you move the file pointer forward or backward. The...

C: how to open a file?, command interpreter, default association
command interpreter, default association, zlatko: Sure that works too. I usually don t use the system call, because it opens a command interpreter to execute the command, so it is an extra step, and it would halt your program until you exit notepad. But I suppose there is nothing wrong with that in your case...

C: question in c language, floating point arithmetic, computer algebra systems
floating point arithmetic, computer algebra systems, floating point representation: Hi Gulshan, Answer is A. Floating-point representation, in particular the standard IEEE format, is by far the most common way of representing an approximation to real numbers in computers because it is efficiently handled in most large computer processors....

C: How to build documentation?, application programs
application programs: Hi Ganesh, /* * Name: * Copyright: * Author: * Date: 28/08/10 17:42 * Description: */ This contains all the revelent information that is required and nothing extra which might look odd. This is what you might be looking for. Thanks,...

C: C programming, brute force solution, character array
brute force solution, character array, elegent: HI Misbah, Its very easy .First of all a simple brute force solution , just use two loops and compare each number with the other numbers. And if you are looking for a more elegent sloution , what you can do is , take an extra array of 256 in case of...

C: c, int array, last element
int array, last element, clrscr: Hi Tejas, I didn t understand your question. I don t see any piece of code where p and q are changing values. First loop is just printing 2 because we have *c in printf and q will point to last element as we are increment q. In second loop we are printing...

C: exe file of c++ program, compatible computer, c compiler
compatible computer, c compiler, c code: Your C++ compiler will create an exe file. Once you have the exe file, you can run it on any compatible computer. You no longer need the compiler. If you change your C++ code, then you will need the compiler again to create a new exe file. The compiler...

C: is there any limitation that we can't open files more than 1021?(in ubuntu 10.04), Ubuntu, too many files
Ubuntu, too many files, linux file permissions: I believe the current default open file limit in Ubuntu 10.04 is 1024. The command ulimit -n will tell the precise limit for the user. You can edit that limit in the /etc/security/limits.conf file. In that file you ll want to add or edit the following lines...

C: Mac Application Development Project Estimates, massive headache, budget project
massive headache, budget project, standalone utility: Brett, Thank you very much for the question, and I ll try to give you the best advice I can with my limited experience. If you re planning on even the possibility of porting your application to an iSomething platform, you ll probably want to work with...

C: Why array index starts at 0?, Why Array Index starts at 0?
Why Array Index starts at 0?: Hi Dear Snehal , My apologies for the delayed response :( .. well getting to the point if we say a[0]; /* Means the first element of the array */ as you know well a is the array name ( which holds the base address of the array ) say if the array...

C: C, scanf
scanf: Hi Aparajita, I don t know what problem you are facing while writing this code as it is very basic ,anyways here is your code : #include stdio.h int main() { int num=0,i=0; printf( Enter thre number: ); scanf( %d ,&num); for(i=1;i...

C: C, c function, getc
c function, getc: Hello Aparajita For ethical reasons, I am not going to write the program for you. I will help you if you show me some effort. Here is some advice. In your program be sure to include stdio.h . Create a main program with a while loop. In the while loop...

C: C, 666666, 55555
666666, 55555: #include stdio.h #include conio.h void main() { int a; printf( Enter a number ); //accepting the value from the user //up to which the output will be displayed. scanf( %d ,&a); for(int n=1;n =a;n++) //for moving vertically...

C: C output confused, c output, cout
c output, cout, dis: Hello Vikas. The line: -a; does evaluate the negative of a , but the result is not stored. To change the value of a , the result has to be assigned back to a . If you change the line to: a = -a; You will get the result you expect. I hope...

C: c language, getch, c language
getch, c language: first of all i am not sir i am a ma am. your program will not execute because you are declaring an integer variable and storing a float value. the program must be #include stdio.h #include conio.h main() { float i; i=1.1; while(i==1.1) { printf(...

C: c-language, linker error, jitu
linker error, jitu, c language: Hello Jitu When a program begins running, the compiler calls the main function. The compiler will always search for a main function in your program. The execution of the program only begins from the main function. main function is the entry point of the...

C: code?, face book, hex
face book, hex, 2e: Hi Rishi, I didn t figure out anything from this series , after converting it to Decimal and it comes out to be : 56 46 40 77 37 42 48 56 38 Which does not reflect anything. If you can tell me the full context , then i might help you out....

C: code ?, hex numbers, ascii table
hex numbers, ascii table, ascii character: They are just hex numbers. It is impossible to say what they mean on their own, without knowing how they are used. Maybe they represent ascii characters. Find an ascii table (google ascii) and convert the hex to the ascii character and see if if spells out...

C: decimal to binary, computer programmers, internal language
computer programmers, internal language, numeral system: Hi Anna, First of all little General Knowledge: The decimal (base ten) numeral system has ten possible values (0,1,2,3,4,5,6,7,8, or 9) for each place-value. In contrast, the binary (base two) numeral system has two possible values, often represented...

C: how this expression is evaluated, stack and stack, incoming operator
stack and stack, incoming operator, second operator: Hi Nitin, In this case compiler start from left and start putting operands into a stack (virtual) and operators into another stack . And when a second operator comes it check the priority of the incoming operator. If the priority is higher in that case...

C: main() in main(), segmentation fault, printf
segmentation fault, printf, thanks in advance: Hi Bhupal , Firstly my name is Abhishek and not Premnath :) Now , comming to your main question m here what we are doing is recursively calling main. Now , for this you must understand how function call happens and what happens if we try to go out...

C: Output, static int, logic
static int, logic, dis: Hi Vikas, Catch here is static int i , when you declare i as static only once the memory is allocated. The variable I is declared as static, hence memory for I will be allocated for only once, as it encounters the statement. The function main() will...

C: Output, && logic
&& logic: HI Vikas, If you see we have i=0 and j=0 declared in the starting of the function . Now , when we encounter the second statement i.e. k=(i&&++j); we get k=0,j=0,i=0 this is because of && logic. The thing with && logic is that in case of && if...