19,876 Topics

Member Avatar for
Member Avatar for unclepauly

hello, im writing an HTTP proxy in C#. the proxy should capture both HTTP and HTTPS traffic from the web browser. so far i have implemented the GET and POST requests no problem, but the CONNECT request i am having a little trouble with. there does not appear to be …

Member Avatar for unclepauly
0
2K
Member Avatar for tomtetlaw

Say you had a struct like this: [code] typedef struct{ int i; short s; unsigned char pad[2]; } test_t; [/code] What would be the point of adding the member pad as doesn't the compiler automatically do things like that? I saw a struct like this looking in some source code …

Member Avatar for Ancient Dragon
0
84
Member Avatar for pseudorandom21

C++/CLI @ runtime add a PictureBox to a tab control, I need to do this at run-time because they're to represent some data the user must be able to manipulate. I actually need them to be in some kind of scrollable panel on the tabcontrol. Any ideas?

Member Avatar for jonsca
0
149
Member Avatar for CodeAerial

HMm... already frustrated at it... But is there something wrong in my malloc? Everytime I try to display the record, it gives me random things as answer(see code below)? Was it that I didn't free it or was I wrong in declaring malloc itself? Thanks in advance. [CODE] #include <stdio.h> …

Member Avatar for CodeAerial
0
283
Member Avatar for srisrisri

Hello Can anyone tell me the way to reverse a string in C and only in """"C"""? How to get a string through one by one characters of the same? And if I use the following I get errors String name="hai"; len=strlen(name); for(i=0;i<len;i++) { scanf("%c",name[i]); } how to get name …

Member Avatar for minhajakhter
0
316
Member Avatar for yassop

Hi all. I have a problem with my calculator. #include <stdio.h> int a, b; /* value entered by user */ char c, choice; int main() { printf("\nThis program is a calculator.\n"); printf("Enter your calculation: "); scanf("%d%c%d", &a,&c,&b); if (c=='+') printf("The answer is %d", a+b); if (c=='-') printf("The answer is %d", …

Member Avatar for yassop
0
241
Member Avatar for iamsmooth

I'm fairly new to C. I've tried googling but haven't found anything. Can anyone direct me to some relevant functions or readings or whatever that might help with this problem? Basically I need to be able to give a directory as an argument and it needs to be able to …

Member Avatar for griswolf
0
171
Member Avatar for ITHope

We have to write a program that prompts a user to input an integer and after that i get lost i attached the problem to this thread and help would be greatly appreciated!!

Member Avatar for ITHope
0
100
Member Avatar for Paritosh Das

[CODE]#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gd=DETECT,gm,year,month,day,cy,cm,cd,i,j,maxx,maxy; int y,m,d; int midx, midy; int stangle = 0, endangle = 360; int xradius = 100, yradius = 50,xradius1 = 2, yradius1 = 2; int radius = 50; clrscr(); initgraph(&gd,&gm,"d:\\tc\\bgi"); maxx=getmaxx(); maxy=getmaxy(); for(i=0;i<10;i++) { setcolor(4); rectangle(i,i,maxx-i,maxy-i); rectangle(9,11+i,629,45-i); } for(i=0;i<315;i++) { delay(3); …

Member Avatar for jonsca
-2
374
Member Avatar for pdk123

i am a c programmer, 6 month old for c++. i am trying to add some feature to a huge c++ base code !. stuck at this funtion . ( function names/varibles names modified ) void MCE::AddM( int Cid, int Tid, int Rid) { TrInstEntry* pTrInstanceEntry = (TrInstanceEntry*)m_MappingList->find(Tid); if ( …

Member Avatar for griswolf
0
186
Member Avatar for l1nuxuser

[CODE] char *CHuser, *CHpass; CHuser = user_user.GetBuffer(0); //user_user its CString verb CHpass = password_user.GetBuffer(0); // password_user its CString verb [/CODE] i need to convert the CString to char but is not woking if someone can help me its gon be very useful ks biny

Member Avatar for l1nuxuser
0
252
Member Avatar for Jcastillo2010

(Linux)I am trying to use this code: /* *Converts pounds to kilograms. */ #include <studio.h> /* printf, scanf,definitions*/ #define KG_PER_POUND .4536 /*conversion constant */ int main(void) { double pounds, /* input - weight in pounds. */ kg; /*output - weight in kilograms */ /* Get the weight in pounds. */ …

Member Avatar for Trentacle
0
172
Member Avatar for Szeth

Hello Daniweb, I'm obviously very new to the programming world. I'm trying to make the popular Guessing random numbers game. The things I'm having a hard time with is getting the input validation to work. When characters are input instead of numbers, the program goes into an infinite loop. I'm …

Member Avatar for Szeth
0
381
Member Avatar for mackemforever

I've just been trying to put together a small piece of code to display the Fibonacci series up to the nth term, where n is defined by the user. I have got it working in a way, it is displaying the series up the the nth term where n is …

Member Avatar for mackemforever
0
124
Member Avatar for iwannalearn

hey i am in a great confusion plz help me out.I have done basics of c++,and now i am in a confusion that whether i should continue c++ or to start with java???? plz suggest me

Member Avatar for Moschops
0
148
Member Avatar for ben25x

I have searched and deleted on this code, but I am still stumped on where the "unresolved external" it's complaining about is. Here is the code:[CODE]#include <windows.h> #include <stdio.h> #include <string.h> #include <tchar.h> #include "resource.h" #define GETITEM(item) GetDlgItem(hWndDlg, item) void convert (HWND hWndDlg) { wchar_t ConvertTime[9], ETime[8], UKTime[8], HKTime[8], Hour[8], …

Member Avatar for Banfa
0
246
Member Avatar for uclaEE

Hello all! I am having trouble writing this code where I am supposed to take integers and output them as strings. When i try a number like 67 it outputs it correctly like sixty seven. However, when i try 467 it only outputs four hundred sixty. Suggestions appreciated! [CODE]#include <iostream> …

Member Avatar for ravenous
0
123
Member Avatar for ckid

HI friends!! I am very new to this type of groups, and this is my first post to this group, before asking u all a help I am just posting this code to u all, , please respond for this code Huffman algorithm is one used for image compression and …

Member Avatar for nilu28
0
3K
Member Avatar for qrkr0730

Write a program that calculates and prints the take-home pay for a commissioned sales employee. Create appropriate variables and enter the values of variables that will change for each employee using Console.ReadLine(); Jessica received 7% of her total sales. Her federal tax rate is 18%. She contributes 10% to a …

Member Avatar for ddanbe
0
81
Member Avatar for pinsickle

I should remember this but I am rusty. I'm passing a char* [] to a function which will hold data that I have extracted using strtok. I've tested the output and it is doing what it is suppose to, at least it is inside of the function. As soon as …

Member Avatar for pinsickle
0
218
Member Avatar for Butterflieq

Hi everyone, I'm taking a C programming class and in addition to being unfamiliar with all of the syntax, I'm still learning my way around a new compiler. I'm currently writing a program that gets a user to input 3 numbers, then it will display the lowest to highest. My …

Member Avatar for gerard4143
0
193
Member Avatar for Spider05

I have been working on a HW assignment for a while and I cant figure out how to print out a 'user' selected column out of an array. I can print the rows, but I need to know how to print specific columns dictated by user input. My code is …

Member Avatar for gerard4143
0
192
Member Avatar for newbie14

Dear All, I am generating a report via crystal report. I am reading data from mysql db and one of the sample field I format is Cast(DATE_FORMAT(tblFranchiseTransfer.franchiseTransferFromDate, '%d-%m-%Y') As Char) as franchiseTransferFromDateOriginal. One problem I have few data which is ordered in this flow 04-01-2011,12-01-2011,13-01-2011,18-12-2010. I have ordered as ascending …

Member Avatar for Momerath
0
96
Member Avatar for Asheem

[CODE]#include<stdio.h> #include<stdlib.h> #include<time.h> #include<stdbool.h> int roll(void) { int num = (rand()%6)+1; return num; } /* void player(void) { int i=0; int sum=0; int dice; char turn; while(i!=6) { printf("Player 1- roll or hold?\n"); turn = getchar(); while(getchar()!='\n'); if(turn=='r') { dice = roll(); if(dice!=1) { sum+=dice; printf("Rolled = %i Your turn …

Member Avatar for gerard4143
0
2K
Member Avatar for anirudhruia

[code] #include<stdio.h> int main() { int n,i,j; char p[10][10]; printf("please enter 10 words"); for(i=0;i<10;i++) { for(j=0;j<10;j++) { gets(p[i][j]) ; } printf("\n"); } for(i=0;i<10;i++) { for(j=0;j<10;j++) { printf("%c",p[i][j]); } printf("\n"); } return 0;} [/code] I actualy want to read 10 string from keyboard and print them but not gettin the output …

Member Avatar for vinayakgarg
0
103
Member Avatar for anirudhruia

How to access structure variables in nested structures [CODE]#include<stdio.h> typedef struct contact { char name[1][20]; struct number { double num; }no; }; [/CODE] Now how to access num ,can anyboddy explain me?

Member Avatar for anirudhruia
0
101
Member Avatar for Madmark88

According to entered number (b), please find the “a” numbers corresponds equation b = a3 * a2. My codes. Whats the mistake ? thanks for helping. [CODE]#include"stdio.h" #include"conio.h" #include"math.h" int main(void) { int a,b = 0; printf("Please enter a number"); scanf("%d",&b); for(int a = 0;a<1000;a++) { if(b==(a*a*a)-(a*a)) { printf("%d",a); } …

Member Avatar for Trentacle
0
161
Member Avatar for ben25x

i have searched everywhere and i cannot find a simple c example for creating a simple click button, where if the user clicks on it, the program prints something to the screen, or something. any help would be very appreciated.

Member Avatar for Ancient Dragon
0
2K
Member Avatar for vbx_wx

I made a server and i tryed connecting using a telnet saying "Connection refused" . What am I doing wrong ? Thanks in advanced. [code] /* * server2.cc * * Created on: Jan 29, 2011 * Author: astanciu */ #include <iostream> #include <winsock2.h> using namespace std; class Server { WSAData …

0
68
Member Avatar for Rishabh876

I made a c++ program but my teacher rejected it because i had used goto function everywhere. she told me that i can use do while instead. so i started replacing goto with do while. after spending so many hours on my desktop when i tried to run it , …

Member Avatar for daviddoria
0
168
Member Avatar for kohoko

i want to get a random value from the set of values like{1,2,5} how can i do that is that possible i m not that familiar with using random function so plz xplain a bit how to use it if it can be used in this case

Member Avatar for kohoko
0
199
Member Avatar for ankit.4aug

Please tell me ..what do you mean by following line void(*fnctn)(void(*)(int *,void **),int(*)(void**,int*));

Member Avatar for vijayan121
0
148
Member Avatar for cufisa

Hello there everyone. I am having a bit of trouble with my C programming. I do not know anything about C programming and this is my first semester and already my professor is putting pressure on me. Anyone that can help would be appreciated. So I am supposed to create …

Member Avatar for cufisa
0
1K
Member Avatar for JDevelop

Hello there, I've just started on C and what I'm trying to do is copying one string to another (which has not been initialized before) without using any string.h functions. Here's my code. [CODE] #include <stdio.h> #include <stdlib.h> void copyString(char*,char**); int main(){ char* string1="Hello there"; char** string2; printf("string1: %s\n",string1); printf("Copying …

Member Avatar for JDevelop
0
285
Member Avatar for Amaina

I'm a newbie to C. Just wondering if i can create input forms in C. Can i also work with C and MySQL?? as in can i build a system using C and MySQL I guess what i'm asking is what are the effective uses of C as a programming …

Member Avatar for gerard4143
0
129
Member Avatar for fab2

[ICODE]Hi, I wrote a program which seemed very simple, a switch case nested in a while cicle. The compiler is not giving any error message, and yet when it's running, it starts an endless serie of loops and I do not understand, why.Here the code [/ICODE] [CODE]#include<stdio.h> int main () …

Member Avatar for ravenous
0
95
Member Avatar for arjunpk

hi guys.... can someone please give me the code to automatically enter the movie name and the imdb id in the website given below... and then pull out the poster which it generates.... [url]http://api.movieposterdb.com/console[/url] i have to use this in an ssis package script component... to pull out images for …

Member Avatar for arjunpk
0
123
Member Avatar for illuminatus89

Is there any way by which I can initialize all the elements of an array(already declared) in one statement?? That is, without using loops

Member Avatar for benwilliams
0
248
Member Avatar for ElegantElephant

For example, I have a string containing "184553", how do I go about extracting the 3rd character "4" from string string and assigning it to another variable? I have tried the following code but it does not work, the system crashes: [CODE] char string[6] = "184553"; printf("%s",string[2]); // Expecting it …

Member Avatar for Ancient Dragon
0
8K
Member Avatar for ben25x

I am quite stumped on something in C. I found this code on the Internet, and it only gives me one error; however, I cannot seem to fix it. The variable in the function the compiler's complaining about is: [CODE]char ConvertTime[8][/CODE] and the function itself is a windows one: [CODE]GetWindowTextW(GETITEM(IDC_CONVERT_TIME), …

Member Avatar for ben25x
0
348
Member Avatar for biljith

how to write a program that can accept a date from user and print the day on which it occurs

Member Avatar for Ancient Dragon
0
107
Member Avatar for daniel1977

I need some help in tracking down a problem I am having. Attached is a zip file that has a bulk of the files used in this assignment. I am recieving a compiler error that I do not know where to look for the solution. The IDE shows the error: …

Member Avatar for daniel1977
0
163
Member Avatar for kylemurray123

I'm kind of new to c++ and i wrote a simple program to convert ounces to grmas and when i had finished i was wondering if there was a user interface so i can make it look appealing?

Member Avatar for Ancient Dragon
0
138
Member Avatar for gf_123

hi I want to write cellular automata lee algorithm (I call it wave method) which searches for the shortest path between 2 points.In lee algorithm the user specifies the weight one for all grid points and the algorithm will find thepath with the lowest number of grid points(it means the …

Member Avatar for hkdani
0
145
Member Avatar for ram619

This code is runnig perfectly for values perfectly divisible by 2, that is 2,4,8 But the i is not incrementing when values are given such as 7,5 could u plz tell me the error Thanks [code=c]#include<stdio.h> #include<conio.h> int fun(int); int main() { int num; float mod,prime,m; printf("enter the num"); scanf("%d",&num); …

Member Avatar for ram619
0
104
Member Avatar for Madmark88

i have recently started to learn c programming and im trying to improve my skill.i have some question about perfect numbers i searched forum but results were about C++. question is this code finds perfect numbers between 1 to 1000000. but its not working after 8128 which is perfect number. …

Member Avatar for Madmark88
0
100
Member Avatar for andylbh

Hi all, I've just started learning server and client communication using socket. What I'm doing here is like a Search Engine. Server stores data (from a textfile) , then client search and check it exists or not. Everything works fine, but I can't seem to loop for multiple search. (Meaning …

Member Avatar for kings_mitra
0
105
Member Avatar for amiroletter

For those C++ fanatics: You are free to visit this website: <MY SPAM LINK REMOVED BY peter_budo> To learn the basics of C++ HAppy COding, Enjoy!!!:icon_smile:

Member Avatar for Fbody
-1
42
Member Avatar for katniss

Write a C++ program that implements an ADT class named Int50 for manipulating integer numbers with up to 50 digits. The operators provided on this type must include: sum (+), difference (-), product (*), division (/) {dropping the remainder}, output (<<), and input (>>) of values for Int50 objects. Each …

Member Avatar for arkoenig
0
125
Member Avatar for b1izzard

Binary search tree for strings. I tried my best to trace out the error but in vain Need help. [CODE] #include<stdio.h> #include<stdlib.h> #include<string.h> struct bstree { char keyword[25]; struct bstree *lnode,*rnode; }*root; void insert(struct bstree *new,struct bstree *old) { if((strcmp(new->keyword,old->keyword))<0 && old->lnode==NULL) { old->lnode=new; } else if((strcmp(new->keyword,old->keyword))<0 && old->lnode!=NULL) { …

Member Avatar for b1izzard
0
948

The End.