19,876 Topics

Member Avatar for
Member Avatar for Anatake

I have a (I thought:confused:) relatively simple converter project I am writing with Visual Studio 2010 C++ Windows Form App. So to be forthwith I am completely stumped as to how I would get the user input from the Amount box (1234.12 for example) and the Rate box (1.04108 for …

Member Avatar for jonsca
0
226
Member Avatar for libathos

hi guys i want to make a c program,what it has to do is to find its current pathname every time it is executed from diferent locations and then redirect the outcome in a .txt file,through cmd.I have lack of knowledge when it comes to cmd so any help?

Member Avatar for kings_mitra
0
128
Member Avatar for archana.c07

Hi all, I am trying to conver string to decimal. the sting is 8 byte long and contains data as hex nembers e.g 0000000000000D72 i want to conver this data into decimal as 3442 i'm not getting how to do this help me...

Member Avatar for Software guy
0
261
Member Avatar for suvind

[B]When should we use for loop and when while in C ? In terms of speed up and memory consideration in embedded systems.[/B]

Member Avatar for Dervish1
0
2K
Member Avatar for judithSampathwa

hi there, i have a two forms and in one of the form there is a button to open the other window which is the second form. what i want to do is, when the second form is opened how can i make the first form in a uneditable mode, …

Member Avatar for judithSampathwa
0
113
Member Avatar for jackmaverick1

I have been studying c++ on my own for about a year (i'm 11) and have mastered classes, functions, logical operations, and some other basic things. Now I'm interested in learning to make and use GUIs. I already know how to make a message box and have the code but …

Member Avatar for jackmaverick1
0
200
Member Avatar for fussballer

Hello, I was compiling some code and get the following compiler errors: error C3861: '_stprintf_s': identifier not found error C3861: '_tcscat_s': identifier not found I got the code from the MSDN Library: [URL="http://msdn.microsoft.com/en-us/library/dd798640%28VS.85%29.aspx"]http://msdn.microsoft.com/en-us/library/dd798640%28VS.85%29.aspx[/URL] I tried to find some info about the _stprintf_s and added the header <tchar.h> This got rid …

Member Avatar for fussballer
0
530
Member Avatar for rapids79

Hi..I want to create a message box that displays the string from an array. Is it possible using MesasgeBox()?? I have tried passing the name of the array to the function but I looked around and found youd could pass only string to the function. So waht is the solution??? …

Member Avatar for Ancient Dragon
0
144
Member Avatar for shinsengumi

can anyone help me make a C program code that will open an image file? i'm using C language and GUI/glade3 alongside it. to help you visualize it, i want to type the image filename in a text view entry and when i click a button (Load for example) the …

Member Avatar for shinsengumi
0
225
Member Avatar for rapids79

Hi, As per the code snippet: [CODE]typedef struct TimeSlotConfigurationList_LCR A { A_SEQUENCE_OF(struct B) list; asn_struct_ctx_t _asn_ctx; } A_t; #define A_SEQUENCE_OF(type) struct { type **array; int count; /* Meaningful size */ int size; /* Allocated size */ void (*free)(type *); } typedef struct B { TimeslotNumber_LCR_r4_t x; ENUM{Yes(0), No(1)} y; ENUM{Ok(0), …

Member Avatar for rapids79
0
130
Member Avatar for fizzle

Hi all, I'm completely new to C but have dabbled with Bash scripting before. I've been trying to get my head around pointers etc. I have a small routine to check for the existence of a string in a file and print to screen, I claim no originality it's a …

Member Avatar for fizzle
0
167
Member Avatar for Shikhin

Hello, I am trying to make a program which will sort a array of 10 elements using bubble sort. I searce dthe forum and google but douldnt find a problem similar to mine. I cam up with the following code: [CODE]#include <stdio.h> #include <stdlib.h> void swap(int *, int *); int …

Member Avatar for Shikhin
0
92
Member Avatar for rapids79

Hi..I am writing a server code for TCP/IP. The code is: [CODE]#include<winsock2.h> #include<windows.h> #pragma comment(lib,"user32.lib"); #include<stdio.h> #include<string.h> #include"tcpip.h" /*Function definitions for communication over TCPIP*/ /*Parameters for TCP/IP Communication*/ WSADATA wsaData; WORD version; int error = 0; SOCKET server_addr; SOCKET client_addr; struct sockaddr_in Start_Server; int length = 0; char tcp_ip_recv[20]; char …

Member Avatar for rapids79
0
267
Member Avatar for Michael27

I'm trying to create login form in C#. I store username and password in SqlServer 2008 express using the stored procedure [CODE]ALTER procedure [dbo].[InsertNewUser] ( @UserName varchar(30), @Password varchar(30) ) as If exists(Select 'True' from Users where UserName = @UserName) begin --This means that the user name is taken select …

Member Avatar for arunkumars
0
171
Member Avatar for cktbrd

I have been away from c for awhile and was hoping that someone could guide me on how to code the following: I have a string for the time that is in the format hhmmss.sss (hour, minute, seconds, fraction of seconds). I would like to parse the string and store …

Member Avatar for kings_mitra
0
273
Member Avatar for mamashi

I have a small problem. I am a begginer in C programming . I need so help please. my project i am working on is in image. I use a camera to take a number in very small part for example ( 0901) but sometime those component have defect next …

Member Avatar for abhimanipal
0
147
Member Avatar for SHENGTON

Hello, good evening. :) I got some problems with the "Bubble Sort" and "Selection Sort". My "Insertion Sort" is already ok. I just can't figure it out with this problem. Hope you can help me with this and explain it to me my mistakes. Here's the whole code: [CODE=C]#include<stdio.h> #include<conio.h> …

Member Avatar for Adak
0
133
Member Avatar for suvind

I have a statically allocated memory chunk and one dynamically allocated. Which one is preferable if a cache friendly function is to be written ?

Member Avatar for Ancient Dragon
0
27
Member Avatar for plike922

i am having trouble fixing this program... its not printing the number any tips??? i am using sieve of Eratosthenes [CODE]#include <cstdio> #include "simpio.h" #include "strlib.h" #include <iostream> using namespace std; int main() { bool is_prime[300]; int num[300]; int i, n; printf("This program prints all prime numbers from 1 to …

Member Avatar for technology
0
131
Member Avatar for xaop

I'm planning to design a program such that any number entered will be divided by all the numbers less than it and if any of the division gives 0 as the reminder,it is not a prime.Here is my attempt so far and iam not able to proceed after that.. [CODE]#include …

Member Avatar for technology
0
737
Member Avatar for aianne

Hello, I'm almost completely useless at C, and as part of a project I've got to conjure up a programme, and I'm just hoping someone can give me push to get it started. I want to make a programme where the user can draw a CIRCLE, SQUARE, LINE and POLYGON …

Member Avatar for jhamelberja@yah
-3
158
Member Avatar for vovasquez

ok so i know how to program in JAVA.. i am trying to learn C but the language is pretty confusing.. so i want to read from a file.. i created a FILE, numbers.txt ---> this file has int values. i have code to read the file, now i am …

Member Avatar for abhimanipal
0
102
Member Avatar for Green Anorak

Hi All Can anyone tell me how to read a file but only print to the screen certain parts of it? Below is what I've got already - apologies if it's very basic, I'm new to this! All I can do is get a program which prints the whole file …

Member Avatar for Ancient Dragon
0
86
Member Avatar for technology

Fellow coders Ive contributed this code to show how to send an email using winsock but Im having problems working out what to do to get this to be SSL oriented and know that it requires something to do with Secure Sockets and SetSockOpt and GetSockOpt and WSAIOctl but Im …

Member Avatar for technology
0
902
Member Avatar for redeorhcsIT

can u help me in my assignment on Turbo C ??? this is the questions .. i need it badly tom.. at 10am in the morning !! Write a program to print a customer bill for Ajax Auto Repair. the parts and labor changes are input and a 6% sale …

Member Avatar for Ancient Dragon
-1
60
Member Avatar for beyondavatars

I am trying to compile my code and the error is in my ADT module .h file at this line: void printList(FILE* out, ListRef L); The precise error is "list.h:42: error: expected ‘)’ before ‘*’ token" Everything seems fine to me with the rest of the program but my compiler …

Member Avatar for Banfa
0
260
Member Avatar for shankarz
Member Avatar for anjoz

can you guys help me out i dont know any of the c++ functions and i dont know how to convert this tnx in advance [CODE]#include <iostream> #include <stdlib.h> #include <fstream> using namespace std; struct student { char fname[100]; char lname[100]; int id; float cgpa; }; int add( student * …

Member Avatar for Ancient Dragon
0
101
Member Avatar for hg_fs2002

Hi,I want to ask how it is possible to read a file without printing newlines? I'm using getline() to read the strings but I want to print all the strings consecutively even if they've been seperated in the file with a new line.

Member Avatar for Ancient Dragon
0
94
Member Avatar for Don_k

Hey guys. I coded the following program below: but I have a problem... I think its perhaps the logic I have used is not too good... here it goes... The program below should: ask the user to enter a letter ('a' to 'z' or 'A' to 'Z') and outputs VOWEL …

Member Avatar for eilans_10
0
158
Member Avatar for Awah Mohamed

hello , i want to know where i can get all the 3d and all the other c++ and c libraries and where can i learn how to use it

Member Avatar for SgtMe
0
41
Member Avatar for dy/dx

hi its been 2 years since the last time i program in c and this is my first after 2 years. So i'm not that familiar anymore to the syntax in c(especially i'm already programming in java). So my problem is, i don't know if i did something syntactically wrong …

Member Avatar for gerard4143
0
166
Member Avatar for baddawg12

The goal of this program is to create a "bag" array and a function that will calculate the Fibonacci sequence. The "bag" array should be initialized to a size of 2 where the the elements in order are 0 and 1 respectively. For example: array[0] = 0 and array[1] = …

Member Avatar for baddawg12
0
177
Member Avatar for anjoz

Hey im kinda new in file handling so can you guys help me out im having a hard time delete data from my .txt file the one here in my code workes but when I example [CODE] printf("Enter Record to be deleted: "); scanf("%s",del); if(strcmp(line, del) !=0) [/CODE] the data …

Member Avatar for Adak
0
84
Member Avatar for Jeevitha V.K

Hi ... i am doin my B.E in computer science amd i was asked to write a programme ... can anyone help me write a c program that can hang the system ... and can u also tel me how to set it right again...[B][COLOR="Green"]:icon_neutral:[/COLOR][/B] and can u tel me …

Member Avatar for finito
-6
159
Member Avatar for tucanoj

I've been playing around with recursion a little bit, admittedly it's been some time since I've used it, and I'm feeling pretty rusty. I was simply trying to recursively reverse a linked list and wasn't getting anywhere and finally google'd some code and came across the below snippet, [code=c] node …

Member Avatar for tucanoj
0
127
Member Avatar for shankarz

[CODE]main() { char name[10],s[12]; scanf("\"%[^\"]\"",s); }[/CODE] How this scanf will scan?

Member Avatar for shankarz
0
99
Member Avatar for natd

I'm having trouble with my program. It randomises the craps results i.e how many games are won or lost on a particular roll. The problem is, it is supposed run 1000 games but it also randomises the number of games too. Usually between 1000 to 1005. I think it is …

Member Avatar for smurf6189
0
112
Member Avatar for Member 784291

how to make a program run when an external device is plugged in???(program run from the computer not an autorun from the flash)

Member Avatar for wisaacs
0
80
Member Avatar for jhaycee12
Member Avatar for hareaswar

i am also seeing the similar problem.. the code is here.. [code=c] #include<stdio.h> #include<string.h> int palindrome(char *a,int n); int main() { char a[20]; int b,n; printf("Enter the string to be checked\n"); scanf("%s",a); printf("The entered string is "); puts(a); printf("%c%c%c",a[0],a[1],a[2]); //empty line strlen(a); b=palindrome(a,n); if(b==0) printf("%s is palindrome\n",a); else printf("%s is …

Member Avatar for wisaacs
0
371
Member Avatar for praveenshades
Member Avatar for habatra

HI All, i know its a known issue but i am again back with same problem.I am trying to find IP of the host. USed this code.: [CODE]struct sockaddr_in sock_name; int sock_size = sizeof(sock_name); struct in_addr remote_addr; int sockfd, size = 15; if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) …

Member Avatar for CrazyDieter
0
132
Member Avatar for shankarz

[CODE]while((fgets(receiving array,50,file_ptr)!=EOF);[/CODE] How this while is executed?

Member Avatar for Ancient Dragon
0
82
Member Avatar for shankarz
Member Avatar for iqra123

hello! i have to find time in nanosecond of a particular process and for that i am using clock_gettime() function. i tried different codes i got from net but getting same error [QUOTE] error: ‘CLOCK_PROCESS_CPUTIME_ID’ undeclared (first use in this function)[/QUOTE] i have included relavent header file of time also. …

Member Avatar for Banfa
0
2K
Member Avatar for aravind s

Hi. I'm new to daniweb and i am also a novice programmer. I have this assignment to get a shape, then a shape inside that one, and then another inside the second one, and then fill each shape in with different patterns. Here is an example. if the user enters …

Member Avatar for hinduengg
0
293
Member Avatar for mark88211

this is what i have so far, i need to combine 2 c strings, print them backwards and figure out whether they are a palindrome or not. (the for loop is where i stopped, it could be wrong) [CODE]#include<iostream> #include<cstring> using namespace std; int main( ) { char s1[15], s2[8]; …

Member Avatar for bagi.padhu
0
425
Member Avatar for Joe Shmoe

I am a VB programmer, so I know a lot about programming. I am just new to C and want to ask a simple question. How can I read a file and use strtok with space as the delimiter and have access to all tokens in memory? The example provided …

Member Avatar for Ancient Dragon
0
128
Member Avatar for MrBentley

[CODE]#include <stdio.h> #include <string.h> #include <ctype.h> int getemail (char * email); int getfirstname (char* firstname); int getlastname(char * lastname); int getphonenumber (char * phone); void main () { char email[30]; char firstname[80]; char lastname[80]; char phone[15]; int namevalid; do { namevalid=getfirstname(firstname); if (namevalid ==1){ printf("You entered: %s, A good name\n",firstname); …

Member Avatar for jonsca
0
211

The End.