155 Posted Topics

Member Avatar for NV43

atof() converts a string to a double, except in your case you are giving it not a string, but a single character.

Member Avatar for NV43
0
100
Member Avatar for dellat

[QUOTE=dellat;1647999]Has the following code any practical utility apart from showing the working of pointers? [/QUOTE] Yes, that specific technique is highly employed in viruses for code injection.

Member Avatar for dellat
0
175
Member Avatar for N1GHTS

Lets say I have a shared library in Linux, written in C, with a single function that simply returns the pointer to a string literal. [code]void *ReturnObject() { return (void *)"\xFA\x03\x44\x10\xE0"; }[/code] When this library is loaded by the host application at runtime and this function is called, is the …

Member Avatar for N1GHTS
0
152
Member Avatar for Muhasin

First you must pick a database. This is just a few, most of them are free: PostgreSQL: [url]http://www.postgresql.org/docs/8.4/static/libpq.html[/url] MySQL: [url]http://dev.mysql.com/doc/refman/5.0/en/c.html[/url] Microsoft SQL: [url]http://msdn.microsoft.com/en-us/library/aa936940%28v=sql.80%29.aspx[/url] SQLite: [url]http://www.sqlite.org/c_interface.html[/url] Oracle: [url]http://orclib.sourceforge.net/[/url] ODBC (Any): [url]http://www.easysoft.com/developer/languages/c/odbc_tutorial.html[/url] Then you need to link your program to it. Pick your compiler and find out how to do it. GCC: …

Member Avatar for N1GHTS
0
89
Member Avatar for N1GHTS

I am designing a project geared towards business and is built in C language. The design of the various interface screens are currently in XML/CSS. The target platform is a PC running linux or windows. To compile the software, I first run a source-to-source compiler which converts the XML/CSS into …

Member Avatar for TrustyTony
0
243
Member Avatar for fullarmorzz

[B]Adak:[/B] [code] if((strcmp( name, "positive" )) == 0); //note 6 parenthesis if( strcmp( name, "positive" ) == 0); //note 4 parenthesis [/code] Since [B]strcmp[/B] is not a macro, there is no compile difference between those two lines. Why do you add the extra parenthesis?

Member Avatar for Onlineshade
0
123
Member Avatar for SamY

I am confused at this thread. An operating system is nothing special. It is just a platform for which software can run in a target hardware. Beyond that: its a methodology, a strategy, a concept. I have yet to read any philosophy or goal beyond simply reinventing the wheel. Why …

Member Avatar for Schol-R-LEA
0
272
Member Avatar for YAMNA MIDHAT

Here you go YAMNA MIDHAT! I hope you one day get a job at Microsoft. [code] #include <textedit.h> #include <fonts.h> #include <richedit.h> #include <intrface.h> int main(void) { TextEdit TextEditor; TextEditor.Init(); TextEditor.Default.SetFont("Arial"); TextEditor.Default.Color = TD_BLACK; TextEditor.Launch(); while (Globals.Interface.ProcessMessages()) TextEditor.ProcessEvents(); return 0; } [/code]

Member Avatar for YAMNA MIDHAT
-5
4K
Member Avatar for cse.avinash

[B]You need to create a program to perform this:[/B] [I]The number of digits in the positive integer x is exactly log(x) + 1, rounded down, where the log is base 10, or you could write ln(x)/ln(10) + 1, rounded down. (Of course, if x is not a perfect power of …

Member Avatar for TrustyTony
0
281
Member Avatar for KOFguru

[quote]I can understand at how geniuses feel ( but i dont belong to the geniuses.....I'm just a normal guy^^) [/quote] I finally understand Narue's avatar. It is so appropriate for this thread that I am attaching it to this message. KOFguru, I have a strong feeling that you are out …

Member Avatar for ashwin k v
0
214
Member Avatar for Efficience

[code] switch (2) { int x = 10; case 2: printf("Case 2: %d\n",x); break; } [/code] Is the same as... [code] goto 2; int x = 10; 2: printf("Case 2: %d\n",x); [/code] Which is the same as... [code] printf("Case 2: %d\n",x); [/code] And since x is not initialised with any …

Member Avatar for Efficience
0
459
Member Avatar for Simplified

I have had situations where I needed to graph a complex mathematical model for some application, such as compression, encryption, image, and number theory analysis. I honestly didn't think there were programs out there that do this kind of thing. What I would do instead was just make a GUI …

Member Avatar for Simplified
0
158
Member Avatar for ashu12v

Have you read this? It might help. [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1069894816&id=1043284351[/url] Has it worked with Windows 7 before?

Member Avatar for N1GHTS
0
478
Member Avatar for alex1050

[quote]Your indentation is horrid[/quote] His indentation looks horrid, but notice that some of his lines are tabed and some are spaced. I have this problem too when copying code from an IDE where tabs are set to allocate an unconventional specific number of fixed width spaces. It makes copying terrible. …

Member Avatar for alex1050
0
107
Member Avatar for Hesham Moustafa

What programming interest specifically do you have? Device drivers? Kernel/service modules? Single/Multi-threaded? Firmware? GUI? Gaming? Demo/Multimedia? Audio? Video? Software plugins? How about project size? Project role? Project difficulty? Project depth and dimentions? How long do you want to spend on it? A role involving applying updates? Debuging? Testing? Do you …

Member Avatar for N1GHTS
0
167
Member Avatar for cesione

The conversion methods used in this thread are inefficient. Just now I created and tested two functions for you to use that perform [B][I]Binary String to Integer[/I][/B] conversion and [B][I]Integer to Binary String[/I][/B] conversion. They are the most efficient I could possibly make them. Any more efficient and i'd have …

Member Avatar for N1GHTS
0
2K
Member Avatar for N1GHTS

I am developing an OpenGL application (mostly 2D Ortho) compiled in gcc. As a requirement, in order to offer remote online tech support for the application, I need to be able to view and control this application remotely from time to time using something like VNC viewer. I tried using …

Member Avatar for N1GHTS
0
225
Member Avatar for kandarpa

The answers posted in this thread are all very good. Still, here is a practical answer to your question. This is a bad way to clear memory for an enormous string: [code] char *EnormousString; EnormousString = calloc(999999999999999); [/code] It works good for small strings, but if its a precious cog …

Member Avatar for N1GHTS
0
3K
Member Avatar for N1GHTS

I have been coding in C for a very long time, and I thought I had it all figured out, until I saw this code in an MD5 library: [code] static void MDPrint (mdContext) MD5_CTX *mdContext; { int i; for (i = 0; i < 16; i++) printf ("%02x", mdContext->digest[i]); …

Member Avatar for N1GHTS
0
205
Member Avatar for pardhu463

I'm a big fan of reinventing the wheel. And I'm also a huge fan of bit manipulation. First of all, I agree that if you are making a calculator program you should prepare for numbers a computer may not be able to calculate with standard types. So a bit-level approach …

Member Avatar for N1GHTS
0
196
Member Avatar for smith09

News, Wikipedia, and Wolfram Alpha. That's the only reason to be on the internet for me.

Member Avatar for savis1
-6
824
Member Avatar for kimlong008

For anyone confused on his question, he is asking about how to correctly use the SAPI in Microsoft Windows. Here is a tutorial straight from Microsoft explaining step by step how to do this: [url]http://msdn.microsoft.com/en-us/library/ms720163%28VS.85%29.aspx[/url] Here is an easy way to do it if you are using Visual Studio with …

Member Avatar for kimlong008
0
164
Member Avatar for JDevelop

Here is a way to do it. Convert the [B]TestInput[/B] to your [B]scanf[/B] implementation. Also not included in this example is a main function, the includes, and the [B]free[/B] functions which free the memory created by [B]realloc[/B] and [B]calloc[/B]. [code] #define MAX_STRING_SIZE 256 typedef struct { // This structure will …

Member Avatar for JDevelop
0
325
Member Avatar for dragonpunch

[B]> and neither am i running the app on a pc or mac[/B] I love embedded programming! Its like crispy bacon in the morning for me. If you are running a unix/linux based OS, you could use system calls to embed the functionality of existing free or open source command …

Member Avatar for Ninetie
0
158
Member Avatar for chris5126
Member Avatar for chris5126
0
488
Member Avatar for karpe

I love programming for electronics. Its like watching your programs come to life, literally! [B]printf()[/B] is an awesome function, and its strange to see such code not behave properly. Here is an idea which might work in your specific implementation. Basically I use [B]snprintf()[/B] to do the work of converting …

Member Avatar for karpe
0
186
Member Avatar for mi.mac.rules

I haven't tested this code, I just threw it together in a few minutes. It should do everything you need, and its extremely efficient. The parameters would be like this: ./program <Number #1 hex/int/bin/oct> <Number #1> <div/add/mul/sub> <Number #2 hex/int/bin/oct> <Number #2> <Result hex/int/bin/oct> Its not a fix to your …

Member Avatar for mi.mac.rules
0
241
Member Avatar for vanan4u

I suggest you do something like this: - Create a structure to store each student's information. Maybe call it "Student". - In the "Student" structure, create another structure for each subject, maybe called "Subject". In there, set up your grade variables or arrays, however you want to set it up. …

Member Avatar for vanan4u
0
154
Member Avatar for wvuengr33
Member Avatar for bufospro

I have read this question like 10 times trying to make sense of what you are saying, but I still don't understand. [B]> The problem I have is that I can't write space in my string. > So strings like : "name fullanme" are rejected > and returns only "name".[/B] …

Member Avatar for bufospro
0
185
Member Avatar for deepak.hm123

If you need an explanation on the concepts of string reversing, I have a very detailed explanation in this post: [url]http://www.daniweb.com/forums/thread313164.html[/url]

Member Avatar for N1GHTS
0
214
Member Avatar for CleanSanchez

so many [B]if[/B]'s... so little [B]switch[/B]es... You should consolidate all your [B]printf[/B]'s wherever possible so that the logic can also be consolidated. I also suggest that you convert all your hard coded numbers into [B]enum[/B]erations so that its more legible. This isn't a solution, just a coding suggestion.

Member Avatar for CleanSanchez
0
150
Member Avatar for penny90

I agree with the reputation comment. While I love a good challenge, especially in C, your presentation of it as a newcomer on this forum appears borderline spam. As a suggestion, don't start any paragraph in the English language with a sentence fragment such as "this is the output". The …

Member Avatar for WaltP
-1
147
Member Avatar for adarshcu

[B]> Really sorry to answer to a two year old thread. I didnt look at the date just answered the thread which appeared at the top. [/B] No worries, It happens to the best of us. Its interesting to see so many questions that pop up occasionally on the subject …

Member Avatar for N1GHTS
0
173
Member Avatar for myk45

[B]void[/B] is a special type which is like a place holder for any type. [B]void[/B] pointers are used as a kind of "incomplete cast" which allows you to store values without first specifying its type, but you must later specify its type by casting before using a void pointer. [B]void[/B] …

Member Avatar for myk45
0
97
Member Avatar for mebrahtom

Someone told you that file operations are best for a multilingual dictionary application? Unless you phrased your question incorrectly, then you really should not listen to those people. It sounds to me like what you need is to learn about databases and how to work with them. In the year …

Member Avatar for N1GHTS
0
163
Member Avatar for kangkan_14

[B]> n of crse u ppl are grt..!! [/B] Just letting you know that I think your keyboard might need to be replaced.

Member Avatar for N1GHTS
0
177
Member Avatar for penny90

String comparisons in C using the standard library functions can't directly be used in a switch, and you are basically doing the most efficient way from the perspective of the CPU, which is why as a C program its [B]always[/B] best to avoid using strings if you can use enumerators …

Member Avatar for N1GHTS
0
155
Member Avatar for gahhon

[B]> that is the same result if i change the void main into int main(void);[/B] So not to let this point go unchecked, [B]void[/B] should never be used as the return of a C program's [B]main[/B] function. If you are learning C, and your intention is good programming techniques, don't …

Member Avatar for N1GHTS
0
215
Member Avatar for cbebop7

[B]fscanf[/B] is a perfectly fine function to use for a configuration file with an absolute fixed format. I use it all the time. Wonderful function. Here is an example which could be very relevant to you. This assumes linux. In windows, use the CR/LF combination. This is the data structure. …

Member Avatar for cbebop7
0
963
Member Avatar for quietcity2012

I'm a little confused with exactly what this is. Why is almost everything returning 2? Is this a copy/paste from an assignment? Are you expecting us to do the work for you? This isn't a "specific" question.

Member Avatar for N1GHTS
0
394
Member Avatar for upendrap

[B]>> i need to import one file whic is of .hex extension[/B] file.hex <- one file [B]>> so i need to import a file which should be exactly same name with .hex extension[/B] folder1 / file.hex folder2 / file.hex <- Exactly the same name [B]>> how should i implement such …

Member Avatar for Martin B
0
80
Member Avatar for buzzlightyear79

I don't like the idea that you are assuming that the user will always enter a capital letter. Why are you not using this? [code] #include <stdio.h> #include <ctype.h> [/code] [code] ch1 = tolower(ch); [/code] Its safer in that it checks weather the user typed upper-case or not.

Member Avatar for N1GHTS
0
103
Member Avatar for Ogakor

I believe the concept of a linked list is that there are many sub lists inside one big list, with each element of the lists randomly scattered within the array, yet linked by pointers to the next element somewhere in the chaos of scattered elements in an effort for some …

Member Avatar for Martin B
0
199
Member Avatar for iLoveNoodle

[b]> i don't really want to live in a nice house for a country that i don't care. my goal is to take over a small island, anyone thinking the same thing? but of course, a nice house is a back-up plan, always need one of those [/b] Usually when …

Member Avatar for Elihu5991
0
220
Member Avatar for saad749

This is more information on [b]initgraph()[/b] which changes the screen resolution: [url]http://www.cs.colorado.edu/~main/bgi/doc/initgraph.html[/url] But obviously it doesn't support 24 bit color. If you wanted to force [b]initgraph()[/b] to use 24 bit color, you'd have to create your own screen mode driver, which in Turbo C might prove to be very difficult. …

Member Avatar for Ancient Dragon
0
613
Member Avatar for progcomputeach

8-bit assembly is extremely fun. C is also really fun also. C++ isn't as fun (just structuring your objects and letting the compiler do almost everything). Back in the day I played around with HyperScript for Macintosh. That was fun too, even though it was extremely limited. I guess the …

Member Avatar for MeSam0804
0
152
Member Avatar for jay1648

[b]Person person = *p1;[/b] This is copying the pointer address to the first 4 bytes of [b]firstName[/b] in the newly created instance of [b]Person[/b], and then completely undone by line 27: [b]strcpy(person.firstName, "Modified1");[/b] Which overwrites the 4 bytes written by the previous line of code with the given string constant. …

Member Avatar for N1GHTS
0
2K
Member Avatar for unnamed17

With all due respect [COLOR="Red"]Ancient Dragon[/COLOR], the [b]best[/b] solution to his problem is not ODBC. ODBC adds additional layers of overhead and configuration complexity to the more obvious solution of linking to the MySQL C library which exposes nearly all the same commands he used in his PHP code. Here …

Member Avatar for N1GHTS
0
146
Member Avatar for unnamed17

I will just add that if this is a new project, using an XML configuration file format or using the registry could be better solution than using INI files to store software settings.

Member Avatar for N1GHTS
0
97

The End.