15,552 Topics
| |
I have been reading the head first book about C and I am having a bit of problem with one of the given examples. The example is shown talking about a "code magnet" for a game of blackjack. I went to try out the code and tried to make my … | |
Today I am going to show you how to create a C project in Visual Studios. ***Step 1.*** Launch Visual Studios and select **Visual C++** in the start window. In the Visual C++ section, click on **Win32 Console Application**. Give your project a name and click submit. *Step 2.* A … | |
I created a simple password program which takes a string when its invoked, and prints thank you if its correct. Now I want to write a brute forcer. The password is a 4 blocks 4 digit password ( example 1234 5678 9012 3456, so its called like this C:\>pass 1234 … | |
This is a shameful question for me to ask but how do i keep the debug window open... it keeps on closing automatically rather than me closing it manually. I am using visual studios and it used to work when I just simply click (ctrl + f5). I doesn't work … | |
How do i create a c project properly in visual studios. They (Youtube) say to click on the C++ button and change it from .cpp to .c. But when I debug my code to see my code compiled, I get an error saying that a PDB file is missing. What … | |
Hi, I have written a c code that finds euclidean distance between corresponding elements of two 2D arrays. i have taken two text files like this.. 9.0444 0.083404 -0.30599 -0.21367 -0.032527 -0.048789 -0.17683 -0.10523 0.050547 -0.028377 -0.06061 -0.0011242 -0.031838 9.164 0.18631 -0.3277 -0.1631 -0.014165 -0.041347 -0.063973 -0.059217 0.1422 -0.076865 -0.22507 … | |
while trying to compare times between two different ways of determing whether a number is odd/even without using modulo, i thought of using `long long int`s which my codeblocks compiler aint supports . and so i installed pelles c.( supports c99/c11 which inturn supports long long stuff.. ) and im … | |
i want to write a C logic which would do the scnning the entire host in the network. i hve got IP address ,subnet mask and networka address till now by my code. But i don't know how to start..i want the functioanlity similar to NMAP. yours sincerely aditya prakash | |
This function takes a string and an output buffer and a desired width. It then copies the string to the buffer, inserting a new line character when a certain line length is reached. If the end of the line is in the middle of a word, it will backtrack along … | |
Here is a linked list code in C , It does not give expected output . Input NUMBER OF ELEMENTS -3 but it takes only 2 element and prints them with an extra zero. here is the output **ENTER THE NUMBER OF ELEMENTS 3 1 2 The list contains 0 … | |
What is the best multiplication algorithm which has lower time complexity than Strassen's multiplication algorithm?? | |
can you please explain me what exactly it is ? i have read from my book, wiki link and 1 more link. i got some basic things, can you tell me how exactly this helps process and OS ? how this thing help us to implement cache ? i think … | |
Hello guys, I need to make a C program that reads a text file for example the following sentence: 5 + 7, 10-15 ... (etc.), and show the result. I managed to make it solve part of the problem. The program is making the sum of the first line. But … | |
Hello everyone, new user here and not a frequent user of C so please don't be harsh at me :P What I'm trying to do is read some data from a txt file, like these: > XX10X11110100X0011111XX1011101X101111XX1X1X1111X11X110111110XX11,000 > 010101100XX1110000110X00110111100010XX001101101X1011X10XX0X0XX01,001 and copy them to 2 string arrays. The first array's first … | |
We are able to capture the whole packet hex values. The issue now from the hex values we want to dissect the level 3 protocol, application level protocol and also if the url value is present in the packet. How best to achieve this in C? | |
for a basic ascii checker code of less than 10 lines , i want to print out stuff immediately , instead of after a newline. i understand that stdout is a bufferedstream , and so it will by default wait for a '\n'. i was looking at [this](http://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin) page for … | |
#include<stdio.h> #include<conio.h> struct Book { char bname[20]; int pages; char author[20]; float price; }b1[3]; void main() { struct Book b1[3]={ {"BOOK1",700,"ypk",12.98}, {"BOOK2",500,"aak",350.00}, {"BOOk3",120,"HST",450} }; for(int i=0;i>3;i++) printf("%d\n",b1[i]); getch(); } iwant output book1 700 ypk 12.98 book2 500 aak 350.00 book3 120 hst 450. | |
I'm getting a syntax error that's confusing me beyond belief. I'm using MinGW on Windows XP(32-bit), and Notepad++ for a text editor. "Syntax error before unexpected token '('" Originally, I thought it may have been something in the code I was trying to compile, so I wrote a simple "hello … | |
I need help reading my arp replies. When writing requests to the socket, I cant get replies related to what I sent..Ideas #include <stdio.h> #include <ctype.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <netdb.h> #include <sys/socket.h> #include <arpa/inet.h> #include <linux/if_ether.h> #define ETH_HW_ADDR_LEN 6 #define IP_ADDR_LEN 4 #define ARP_FRAME_TYPE 0x0806 #define … | |
Hi guys, I'm working on a side project for a friend and I'm looking for a C++ library that allows me to put bunch of paragraphs in a PDF format. Anyone know any good libraries that can do this as simply as possible? It will be just paragraphs and paragraphs … | |
#include<stdio.h> #include<stdlib.h> #include<string.h> static int compare(const void *x,const void *y){ return strcmp(*(const char**)x, *(const char**)y); } int main(){ FILE *p = fopen("file.txt","w"); char ch = '\0',**c = (char**)calloc(6,sizeof(char*)); int n[6]={0},i=0,j=0; fprintf(p,"jack\nakki\njohn\nrachael\nrobin\ntom"); fclose(p); p = fopen("file.txt","r"); while(1){ while((ch=getc(p))!= '\n'){ if(ch == EOF) break; putchar(ch); n[i]++; } printf(" %d\n",n[i]); if(ch == EOF) … | |
I'm pretty comfortable with "C", but where I lack, is understanding what types of options must be passed to compiler to produce the tightest code possible. Here is an example of a formula in "C"; int ADDR = VIDEO_BASE + (WND_X + POS_X) + ((WND_Y + POS_Y) * SCR_X) * … | |
#include<stdio.h> #include<conio.h> #include<string.h> struct { int num1,num2; char s1; int *ptr; int abc[5]; }a[2]; void main() { int start, last; start=&a[1].num1;//error last=&a[0].num1;//error printf("\nsize of structure :%d bytes",start-last); getch(); } getch(); } | |
i have matrix which contains first column as index second and third as values in one c file and in other file [index operations] when i call the two files from the main program it should be [1 2 3 ] [1 Add] [1 5] file 1 file2 main program … | |
A prime number (or a prime) is a natural number greater than 1 that can only be divided by 1 and itself. Ex-First few Prime number are- 2, 3, 5, 7, 11, 13, 17, 19,... A digit prime is a prime number whose sum of digits is also prime. For … | |
I have an array of integers.Let's assume int a[5]={1,2,1,2,2};.I want to divide this array into two arrays by extracting some elements of array "a[5]" into some different arrays like "b[2]" and "c[3]",such that int b[2] will contain {1,2} and int c[3] will contain {1,2,2}. How can it be possible using … | |
I want to increase my logical skill for good programming, what should i do to do so ? How can i be a good programmer in C ? Please Help !! | |
Hello, in this code snippet I am not able to understand line 8 and 10. Here at line 8, char* is getting typecasted as int* then again, getting typecasted as char*. Please explain. #include<stdio.h> int main() { int arr[3] = {2,3,4}; char *p; p = arr; p = (char*)((int*) (p)); … |
The End.