19,876 Topics

Member Avatar for
Member Avatar for oscargrower11

Following a tutorial, I built a small sample program that uses winsock. It compiles, but there are a few different places I'm not sure what's happening with the pointers. Full source is available [here](http://pastebin.com/NTdCWhWr) Line 25: `struct hostent *host;` As near as I can tell, this creates a pointer to …

Member Avatar for Moschops
0
262
Member Avatar for Spanky_12

#include <iostream> using namespace std; void get_temps(int choice) { if(choice == 1) { double temps[12]; for(int i = 0; i < 12; i++) { int month_num= i+1; cout << &"Please enter the average temperature for month " [month_num]; cin >> temps[i]; } } if(choice == 2) { double temps[10]; for(int …

Member Avatar for mrnutty
0
245
Member Avatar for joseph619

i need to use webcamera to take picture to gimp....i need a plugin so plz help me out i dnt know how to connect webamera to gimp...somebody plz come with a code explenation

Member Avatar for joseph619
0
177
Member Avatar for ronnel09_1

#include<stdio.h> #include<conio.h> #include<dos.h> void main() { int minutes,seconds,timeremaining,input=1; char cAns,cAnswer; clrscr(); gotoxy(35,15); printf("Press S to start the game: "); cAns=getche(); if(cAns=='S'||cAns=='s') { clrscr(); printf("\nAre you a human? Y or N: "); scanf(" %c",&cAnswer); timeremaining=input; do { input=timeremaining; minutes=input/60; input=input-(minutes*60); seconds=input; gotoxy(1,1); printf("%02d:%02d",minutes,seconds); timeremaining++; delay(1000); }while(timeremaining<=90); if(timeremaining>=90) { clrscr(); gotoxy(33,12); printf("TIME'S …

Member Avatar for ronnel09_1
0
533
Member Avatar for anumash

I have a very confusing question to ask and it is the difference between array of pointers & pointer to an array. I want to understand this concept very well so please please do help me understand this concept. I'll start with what I have understood about array of pointers. …

Member Avatar for anumash
0
167
Member Avatar for saurabh.mehta.33234

The following code gave error on gcc compiler int main() { extern int a; printf("%d",a); return 0; } static int a=5; But when static is removed from int a then it runs with no errors..Can someone please clear the doubt??

Member Avatar for saurabh.mehta.33234
0
312
Member Avatar for ronnel09_1

I just want to ask if i can run a timer at the same time with my program? It is like a quiz bee, i'm asking questions and there is a specific time to finish answering. Thank you!

Member Avatar for ronnel09_1
0
95
Member Avatar for Potgiesh

Hey guys i have an advanced programming project , which is to run on both linux and windows operating systems. And i wanted to know if there is an IDE with drag and drop features which i can use to code the graphical user interface

Member Avatar for mike_2000_17
0
467
Member Avatar for mical700

I am getting wrong output. My Code is following, in which I have to use function unsigned long powerof2(int n); #include <stdio.h> #include <stdlib.h> #include <math.h> //int powerof2(int n); unsigned long powerof2(int n); int main(void) { printf(" n 2^n\n"); printf("-- ---\n"); for (int n=0; n<65 ;n++) { //printf(" n 2^n\n"); …

Member Avatar for mical700
0
232
Member Avatar for mical700

I am trying to print: 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 11 2048 12 4096 13 8192 14 16384 15 32768 16 65536 17 131072 18 262144 19 524288 20 1048576 21 2097152 22 …

Member Avatar for mical700
0
396
Member Avatar for fedaa91

hi i am trying to read a file and save to array i wrote one and it worked accept it not reading ot line by line, so i wrote another one but i am trying to make it as function when i make function call i get this error read.c:32:13: …

Member Avatar for fedaa91
0
205
Member Avatar for fedaa91

hi i have this small problem in my code which is that when i run the code it enters to the wrong condition i mean in the if clause where i enter "download" it executes the body of the upload even though the first if clause condition meet and the …

Member Avatar for fedaa91
0
153
Member Avatar for cproger

I type in <graphics.h> and "graphics.h" for terminal on my mac and it says fatal error: 'graphics.h' file not found Please help me.

Member Avatar for cproger
0
159
Member Avatar for rory.duncan.14

Thanks in advance for anyone who can a)understand this, and b) give any help in my struggles. We are coding in C++, have half a circle, starting a a certain point (e.g. (0,-310)) and finishing at a certain point (0,310). We have the radius, and we have the equation X^2 …

Member Avatar for Ancient Dragon
0
192
Member Avatar for saurabh.mehta.33234

the foll code when run on gcc compiler gave 12 as output `struct aa{char a:3;int b:30;char c:3;}; printf("%d",sizeof(struct aa));` but when i replace size of c to 2 then it gives 8 why is that so?? sizeof int is 4 and char is 1..

Member Avatar for nullptr
0
110
Member Avatar for gunnerone

Hi, I have this simple program that should draw a cube for the user by reading the data in from a text file which looks like this. 8 100.0 100.0 -100.0 -100.0 100.0 -100.0 -100.0 100.0 100.0 100.0 100.0 100.0 100.0 -100.0 -100.0 -100.0 -100.0 -100.0 -100.0 -100.0 100.0 100.0 …

Member Avatar for Ketsuekiame
0
444
Member Avatar for write.me

This code calculated the variance to be 9.75. It really is 9.3, what am I doing wrong? static double computeVariance(ref double Variance, params int[] intValues) { int sum = 0; for (int n = 0; n < intValues.Length; n++) { sum += intValues[n]; } double avg = sum / intValues.Length; …

Member Avatar for tinstaafl
0
155
Member Avatar for krutikasharma

There are a 10 words in statement.i want program in 'C' to find out how many words have the same number of letters

Member Avatar for Moschops
0
106
Member Avatar for blindislands

I need to write a right turn code for a micromouse using sensors but I don't know where to start. Can you help me please? This is the algorithm we developed. > // Right turn while sensor 1 is OFF // initialize RTcounter = 0; if (sensor 6 == 0) …

Member Avatar for Adak
0
246
Member Avatar for dendenny01

My Program contains 4 arrays and I want to sort the array in such a way that if one array is sorted the other array should follow it Example: unsorted array name code salary date John 52 6500 15 Suzzy 10 1500 20 Mike 20 1451 16 Sorted array(according to …

Member Avatar for Adak
0
233
Member Avatar for Counterpartz

Hello, I'm writing an application that computes the variance and average from a list of integers. Here is the assignment info: Create a function that accepts a list of integers and computes the average and variance of the list. The variance is computed using the following formula. The list of …

Member Avatar for Counterpartz
0
311
Member Avatar for ayesha.anwar.9047

Write a MIPS code for the following C program to run perfectly in Qtspim??? Void main () { Int array[10]; For (i=0; i<10; i++) { array[i]=compare(num, i);} } Int compare (int a, int b) { If (sub(a, b,) >=0 ) return 1; else return 0; } Int sub ( int …

Member Avatar for L7Sqr
0
48
Member Avatar for pandu_kvv

Hi friends... I need to write a program in C which will print all the combinations of a string with non-repeating characters. Example: “Say” will have the following: s, a,y, sa, sy, as,sy, ys, ya, asy,sya,ysa and so on. The string length is not known. The string will be a …

Member Avatar for stbuchok
0
208
Member Avatar for sai.aleenus

**how to draw a line in c program given the slope and intercept of the line**

Member Avatar for Echo89
0
241
Member Avatar for VaibhavJhaveri

Can anyone help me with my problem? Problem : I have 4 text files named datatypes, delimiters, operators and variables, having respective data. I have another file which acts as input to this program. The problem is that I have to check each lexeme of the input file and compare …

Member Avatar for Ancient Dragon
0
95
Member Avatar for harshi414

i just read in a few articles that we need some kind of special drivers for parallel port to access it through c as in win xp and 7 we cannot access them directly ! so can you help me in that !????

Member Avatar for Ancient Dragon
0
222
Member Avatar for vjitsingh

Hi, I installed OpenCV 2.4.3 and added it to system path. Then i added everything in CodeBlocks as described here http://stackoverflow.com/questions/10876052/how-to-compile-a-program-using-opencv-2-4-3-with-codeblocks When i run a sample OpenCV program, CodeBlocks doesn't recognize the header files saying no such file or directory. I have OpenCv2.0 working perfectly fine with CodeBlocks 8.02 on …

Member Avatar for vjitsingh
0
165
Member Avatar for dendenny01

I want to designe a code at display a perticular data Example a time table of the week For instance if someone view a page on monday so it show display result of the table or data which is set to display on monday or if some one view same …

Member Avatar for dendenny01
0
172
Member Avatar for akhil.mittra

Hi, I am trying to create a c++ program for counting the number of occurrences in an array using 2 1-D arrays such that the first array contains the elements and the second array gives the count of the number of occurrences of each element in the first array. Unfortunately, …

Member Avatar for emcela
0
705
Member Avatar for hg_fs2002

I am getting input from terminal using "char *argv[]" parameter in main function. Now, I want to check whether all the inputs are not character (they are not necessarily int, they can be double) but I don't know how to do it here because inputs are pointers and it's not …

Member Avatar for Ancient Dragon
0
134
Member Avatar for firebird102085

Hello Everyone, Off the bat I want to say that I am just learning programming so if my code is missing basics I apologize. I was hoping that you might be able to give me an example of how you would solve this problem. I've spent the better part of …

Member Avatar for firebird102085
0
805
Member Avatar for SHWOO

Can anyone point out why I am getting these errors two errors. [CODE] #include <string> #include <iostream> #include <fstream> #include <iomanip> using namespace std; #include "playerType.h" playerType::playerType(string first, string last, int num, string pos) : personType(first, last) { playerNum = num; playerPos = pos; } // end function playerType void …

Member Avatar for saba.gul.1048554
0
263
Member Avatar for roshu10

hello guys, i am doing a project in c(for college mini project) " to get the status of the I/O devices connected to the PC" pl give me suggestion as i am completely new to this system software concepts. guys pl suggest me some valuable resources, links or codes. because …

Member Avatar for harshi414
0
197
Member Avatar for vegaseat

So you want to find out which day of the week you were born. Well at least some of us do. I actually wrote this program because my whole family was born on Sundays, and my friends didn't believe it! An oldie but goodie, moved from DeSmet C to Turbo …

Member Avatar for jnawrocki
3
1K
Member Avatar for alex910TN

Hey guys, I find myself here once again seeking your expertese. Long story short, I need to create a hash function that will hash a list of lexemes in a programming language to unique indicies in a hash table. The problem is that the lexemes (provided below) must all hash …

0
76
Member Avatar for SoreComet

Hi Guys, I was trying to code in C for the following. You are given with 2 files, file1.txt and file2.txt. The contents of the file contain INTERGER values. Add the contents of the file and write them to another file file3.txt. My code is as follows #include <stdio.h> #include …

Member Avatar for SoreComet
0
366
Member Avatar for nitin1

If you consider any multiple of 3 and then sum up its digits, the sum is always divisible by 3. For eg. 843 is a multiple of 3 and 8 + 4 + 3 = 15 is also multiple of 3. Similarly, for 9, any multiple of 9 satisfies the …

Member Avatar for tinstaafl
0
95
Member Avatar for alex910TN

Hey guys, I have a general question about what is and what is not included in standard C? I have a project and the instructor says we can only use anything that was included in C99. Because I have a heay experience in C++, I often find myself questioning whether …

Member Avatar for deceptikon
0
218
Member Avatar for ahmzy

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml; using System.IO; namespace Enrolement { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { /* This part of my code imports the …

Member Avatar for ahmzy
0
1K
Member Avatar for coding101

I would like to send a dhcp discovery packet progammatically in C. I know C programming, but not network programming. I understand I need to set the dest. ip "255.255.255.255" and src "0.0.0.0". Then send a DHCPDISCOVERY UDP Packet to get a list of available wireless dhcp servers. How can …

Member Avatar for deceptikon
0
146
Member Avatar for ripplex

Hi there What are the various GPL's that can be used with C? I am currently learning SDL and I know of another, Allegro. Just trying to fine tune as well as learn more about C, so I am programming games using C.On a bright sunny day, it would definitely …

Member Avatar for gusano79
0
223
Member Avatar for necrovore

Hello all, I am working on a project and i need to basically copy a directory and its files to another location. I have figured out that xcopy comes in handy for what i want to do.but somehow when incorporated into my C code, it does not work. The code …

Member Avatar for necrovore
0
267
Member Avatar for saurabh.mehta.33234

Why does the following line of code generate error as " pasting / and / doesnot generate a valid preprocessing token"? Can someone please help #define comment /##/ int main() { comment printf("hello"); return 0; }

Member Avatar for deceptikon
0
165
Member Avatar for alex910TN

Hey guys, I have a silly issue that is bothering me. I am trying to read an unknown amount of lines from an input file and basically stop when I reach the EOF. I probably does'nt matter but the assignment is to create a simple lexical analyzer/scanner for a mini-subset …

Member Avatar for deceptikon
0
6K
Member Avatar for Renesme-LuCiFeR

Hi Every One, I Was Wondering If Anyone Could help me With This Problem Or Not... I Just Need A Simple Program, With The Least Amount Of Using Arrays, And Loops... And My Main Problem While Writing It Is When I Want To command The Program To Act Like a …

Member Avatar for Ramesh.YoTLC
0
238
Member Avatar for anestistsoukalis

In lines 359 and 360 i have this piece of code: printf("Oi mathites me ton megalytero bathmo ( %f ) einai oi: \n",max); for (i=Stack.Top;i>=0;i--) { printf("%f, \n",Stack.Element[i]); } And i want to print the results of that Stack...... but nothing happens .. :-/ What have i missed to add …

Member Avatar for Ancient Dragon
0
260
Member Avatar for gamers18

Hi, ive been trying to print out a dictionary item with its List but im so confused about it. Basically I created a dictionary and I managed to add an Item to the dictionary(as a Key) and List of something (as value) Dictionary<String, List<string>> dic = new Dictionary<String, List<string>>(); public …

Member Avatar for tinstaafl
0
5K
Member Avatar for roshu10

hello guys, how to play audio files using c ?? i am just a beginner to c programming and also to this form.. thanks in advance.. :) with regards, roshan

Member Avatar for Moschops
0
375
Member Avatar for sparsh610_1

hello everyone ,, have a look on the program really difficult for me to understand the concept please help

Member Avatar for sepp2k
0
230
Member Avatar for syedalisajjad

#include "LVdefs.h" struct konfigDatei { char tableName[50]; char columnName[128]; char primary1[50]; char primary2[50]; char primary3[50]; char primary4[50]; char primary5[50]; char primary6[50]; }; main( int argc, char * argv[] ) { int loop = 0; int count = 0; struct konfigDatei kd[50]; char line[500]; char *ch; FILE *f = NULL; f …

Member Avatar for syedalisajjad
0
195

The End.