15,551 Topics

Member Avatar for
Member Avatar for modaslam

hello, Can any one tell me how to print the patter [CODE] * *** * for n =1 ** **** **** ** for n = 2 *** ***** ***** ***** *** for n = 3 [/CODE] the code i am having is [CODE] for(i=0;i<=n;i++) { for(j=1;j<n-i;j++) putchar(' '); for(k=0;k<=i;k++) printf('* …

Member Avatar for Narue
0
110
Member Avatar for ahjiefreak

Hi, Recently I have a text file which contain a bunch of numbers :- 1,0,0,1,0................ 1,0,1,1,1................ I would like to read these numbers line by line and stored into an array. However, I get seg fault for this. [code=c] char filename[5000]; char dump; strcpy(filename,argv[2]); while(!feof(tfPtr)) { for (i=0; i<16; i++) …

Member Avatar for Narue
0
125
Member Avatar for thisaintcool7

[code=cpp]#include<stdio.h> #include<stdlib.h> #include<sys/socket.h> #include<features.h> #include<linux/if_packet.h> #include<linux/if_ether.h> #include<errno.h> #include<sys/ioctl.h> #include<net/if.h> #include<net/ethernet.h> #define SRC_ETHER_ADDR "aa:aa:aa:aa:aa:aa" #define DST_ETHER_ADDR "bb:bb:bb:bb:bb:bb" int CreateRawSocket(int protocol_to_sniff) { int rawsock; if((rawsock = socket(PF_PACKET, SOCK_RAW, htons(protocol_to_sniff)))== -1) { perror("Error creating raw socket: "); exit(-1); } return rawsock; } int BindRawSocketToInterface(char *device, int rawsock, int protocol) { struct sockaddr_ll sll; …

0
55
Member Avatar for awoc

here's what i have so far. I don't understand where exactly to put the (valid = MY_FALSE;) and the (badInput = MY_TRUE;) and the (valid = MY_TRUE;). [I]The directions state that:[/I] [B]Declare a contant for true, use 1 (MY-TRUE) Declare a contant for false, use 0 (MY-FALSE) Declare the integer …

Member Avatar for awoc
0
115
Member Avatar for SHIFA JINDAL
Member Avatar for majestic0110
0
40
Member Avatar for sjgriffiths

hello i have the following char *b2b_data_Out[1]={"0"}; The number "0" can change. I have a loop which goes round, and i have an integer value which i am going to use to change the above "0" into whatever value i need Question - How do i assign my integer value …

Member Avatar for Narue
0
85
Member Avatar for nabilchampion

Hi all there is a Windows API function as [CODE]HANDLE CreateFile( LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile ); [/CODE] This function contains argument for share mode.. When I provide it 0 value then no other process can open/access the file already opened …

Member Avatar for Ancient Dragon
0
113
Member Avatar for geska10

write a program that reads the number of student from keyboard. Then it reads each students name, family name and average and keep these values in the memory. Then the program will sort students according to the choice of the user. You must also format the uppercase/lowercase according to the …

Member Avatar for mitrmkar
0
85
Member Avatar for shashanktotre

Dear Friends, i am just a beginner with C and ma learning it since last 2 days. I found it very interesting. But what I want to do now is that i have to make a tool to filter a image with a low pass filter. does any one know …

0
57
Member Avatar for sjgriffiths

Hello I have the following pointer char **pOutData; This contains an array of strings. How do i printf each element in of pOutData Hope someone can help best regards

Member Avatar for Narue
0
81
Member Avatar for bops

Hey, I'm relatively new to OpenGL but I have a little experience in C and I was wondering how I would set the pixel coordinates of an OpenGL windows. Its a little hard to explain what I mean but for example if I would like to instead of having (x,y) …

Member Avatar for bops
0
181
Member Avatar for ravi_techinc

I would have the help from any one to do the program for simulating the algorithms of page replacements in operating system concepts in any programming languages.If it is not possible to say ,please give me other assistance such as other web sites or other references for this as soon …

Member Avatar for Rachnamb
0
99
Member Avatar for rathmal

please i want help for the coding of page replacement algorithms implemented in c language

Member Avatar for Rachnamb
1
612
Member Avatar for hafhag

Thank you for your advancing helping. I do have a problem in how to encode a bank account that has : 1. account number,user name , intial deposit and balance (updatable) 2. that a specific user can see his balance 3. a user can withdraw money 4. a user is …

Member Avatar for jephthah
0
66
Member Avatar for majestic0431

Hello, Is it possible that someone can help me with the following program? There are 500 light bulbs (numbered 1 to 500) arranged in a row. Initially they are all OFF. Starting with bulb 2, all even numbered bulbs are turned ON. Next, starting with bulb 3, and visiting every …

Member Avatar for jephthah
0
156
Member Avatar for severman

could any 1 tell me why this code isnt working right?? two.txt is not wriiten good... this is the code [code=c] #include <stdio.h> #include <conio.h> #include <stdlib.h> #include <string.h> #define LEN 30 #define LENST 6 int *saveid[5]; char *savename[5]; unsigned *savegrd[5]; unsigned *saveavg[5]; int j=0,k=0; int min=0; int skip[6] = …

Member Avatar for Aia
0
106
Member Avatar for smrhab

Hi I am kind of stuck on one aspect of a project that I am currently working on. I have a code for a number guessing game in "C" I need the program to ask the player if they want to play again after the game is done and. I …

Member Avatar for WaltP
0
133
Member Avatar for -genESIS-

Hi everyone. I have a quick question regarding a 2d dynamic array, and how to print it. Here is the code I have so far: [CODE] #include <stdio.h> #include <stdlib.h> #include <string.h> #define merror() {printf("Memory allocation problem \n");exit(1);} int main() { int i,j,k,z; int size; char buffer[21]; char buf[21]; char** …

Member Avatar for jephthah
0
109
Member Avatar for ghaith

Hey, I'm new to Socket Programming, and i've only learned C recently so probably what i'm asking will be very obvious, sorry in advance (= ok Here's my code [code=C] /* * File: Inside_Client.c * Author: Ghaith Hachem and Adel Youssef * * Created on March 17, 2008, 6:12 AM …

Member Avatar for jephthah
0
234
Member Avatar for severman

hi all. i need help... 1.how do i copy a line in a text file into a struct. 2. the text file i have is this: 10 SasonSasoniBenSason 100 100 5 Pinokio 70 90 20 JohnRambo 50 87 3 Elvis 3 77 50 JamesBond 17 1 40 BillGates 91 8 …

Member Avatar for jephthah
0
149
Member Avatar for severman

hello everyone how do i sort an array of 6 number with out using any type of sort and then printing the array sorted? i have a source text file with this numbers {10 , 5 , 20 , 3 , 50 , 40}. i copied the text file into …

Member Avatar for jephthah
0
98
Member Avatar for wonder_laptop

im in new to c, i did this is some program and i used the math library, but i was wondering how is the math library available within the the system? and how can we find the names of the files that correspond to that library? Also, i read something …

Member Avatar for jephthah
0
90
Member Avatar for gsivaram

i need to bind socket address and port for ipv6 programming... i canoot able to bind global ipv6 address by using normal bind command.... help me to bind ipv6 address and port number

Member Avatar for jephthah
0
117
Member Avatar for peaceful_soul

Hello guys, can anybody explain to me whats a simple batch processing facility ? i googled it but i couldnt understand anything. thanks .

Member Avatar for alexander()
0
159
Member Avatar for Gerritt

All I need to know is how to capitalize all of the characters of a string. What kinds of functions would I use?

Member Avatar for jephthah
0
89
Member Avatar for wollacott

can anyone help me convert my c program so it works on a linux system or mac? thank you. [CODE] #include<stdio.h> #include<math.h> #include<conio.h> #include<stdlib.h> int main() { int c; int a, b; char d; pov:system("cls"); printf("Enter the first number\n"); a=getch()-48; system("cls"); printf("Enter the function:\n"); d=getch(); system("cls"); printf("Enter the second number\n"); …

Member Avatar for jephthah
0
92
Member Avatar for williamthelast

i'm trying copy a string to another and adding space between the names but it show a warning c4700 and i don't know why??? [code=c] #include <stdio.h> #include <stdlib.h> #include <string.h> char *convert(char *string) { char *p=string; char *tmp; while (*string==' ')string++; while (*string) { *tmp++=*string++; while(*string >= 'a' && …

Member Avatar for jephthah
0
109
Member Avatar for rrich1103

Alright so.... i have logic errors in my game... and idk how to fix them... can i get some help?..... this is a project due for school... tonight midnight actually... and i'm afraid that if i post my code online that... they'll void my program for plagirism x_X'''... so.... ya …

Member Avatar for Ancient Dragon
0
91
Member Avatar for nelledawg

Hi guys, Okay so this time I need help with string input. I have the whole program (yet again) but I just need to figure out how to change letters of user input to redisplay them. The code is below and it asks the user to input the product description. …

Member Avatar for jephthah
0
104
Member Avatar for Syntax Error

hi there.....i wonder what's the difference with these 2 linked list... [code] 1. struct node { int wage; int hours_worked; int salary; int hoursW; char* name; struct node *link; }; [/code] [code] 2. struct listNode { char data; struct listNode *nextPtr; }; typedef struct listNode ListNode; /* synonym for struct …

Member Avatar for Ancient Dragon
0
201

The End.